Resources

WordPress Plugin Boilerplate

For anyone starting out in development or WordPress development it can be difficult to work out the best way of building your WordPress plugins. What's the best way to organise your code and the best way to write your code in the plugin.

Tom McFarlin has created an open source project to help you create your WordPress plugins, the WordPress plugin boilerplate is a project that can be found on Github and is the ideal code to make a start on your WordPress plugins.

It is a standardised, organised, object-oriented code base for building any WordPress plugin.

wpb

The WordPress boilerplate plugin follows the coding standards set out in the Make WordPress coding standards.

It makes it very easy to organise your code in front-end and admin area only code.

To get started on using the boilerplate you can clone the plugin from github

WordPress Boilerplate Plugin

WordPress Plugin Boilerplate Generator

wpbg

When you first clone the plugin boilerplate there will be a lot of code that you need to change as the class names will be called things like Plugin_Name. Enrique Chavez has made a Boilerplate plugin generator that allows you to type in the Name of the plugin and it will automatically generate the code for the plugin based on the plugin name you entered into the generator.

To try it out for yourself on your next project you can use the tool here.

WordPress Boilerplate Plugin Generator

Back to top

Learn how to code with Treehouse

  • Learn projects with access to 1000+ videos
  • Practice live with our Code Challenge Engine
  • Get help in our members-only forums

Start with a 7 day free trial