- Make a new directory and move into it.
mkdir your-plugin-name; cd $_;
- Download the WordPress Plugin Boilerplate.
curl -LOk https://github.com/tommcfarlin/WordPress-Plugin-Boilerplate/archive/master.zip
- Unzip the file..
unzip master.zip
- Move the files into your plugin directory and delete the zip file and unzip folder.
rm master.zip
mv WordPress-Plugin-Boilerplate-master/plugin-name/* .
rm -rf WordPress-Plugin-Boilerplate-master/
- Find and replace ‘plugin-name’ in the filenames.
find . -type f -name '*' -exec sh -c 'mv "$0" "${0/plugin-name/your-plugin-name}"' '{}' \;
- Find and replace strings within the files.
find . -type f -exec sed -i '' s/plugin-name/your-plugin-name/ {} +
find . -type f -exec sed -i '' s/plugin_name/your_plugin_name/ {} +
find . -type f -exec sed -i '' s/Plugin_Name/Your_Plugin_Name/ {} +
find . -type f -exec sed -i '' s/Your\ Name/First\ Last/ {} +
find . -type f -exec sed -i '' s/email@example.com/your@email.com/ {} +
find . -type f -exec sed -i '' s#http://example.com#http://yoururl.com# {} +
- Start developing your new plugin!