Getting Started

Note: First pass of the docs completed.

Welcome, Herbert is a plugin framework for WordPress. We believe the current approach to building plugins is unorganised and difficult to understand. It makes working in teams or taking over from a previous developer time consuming. It's early days for Herbert but our aim is to solve this.

Namespacing your Plugin

To avoid conflicts with other plugins or the WordPress core its important to set a namespace. To get started let's open up composer.json and find the autoload section. As standard it looks like:

"autoload": {
"psr-4": {
"MyPlugin\\": "app/"
}
}

Now let's update MyPlugin with your namespace. Generally you'll want to use your plugin name without spaces. For example: Our plugin called Social Icons (pro) would become SocialIconsPro. Now the autoload section would look like:

"autoload": {
"psr-4": {
"SocialIconsPro\\": "app/"
}
}

We need to tell composer that we've made this change. In your plugin root run composer dump-autoload. Now at the top of each of the following files: