This template is amazing! How can I ever repay you? I'll merge the request if it fits into the goals for the template and credit you in the changelog. Please submit all pull requests to the develop branch. If you would like to contribute to this template then please fork it and send a pull request.
![wordpress template wordpress template](https://s.tmimgcdn.com/scr/50900/50907-1-original.jpg)
See the changelog for a complete list of changes as the template develops.
Wordpress template code#
For example use the following code to let your options page display under the Appearance parent menu. When using submenu also set the parent_slug key to your preferred parent menu, e.g themes.php. Set the location key to options, menu or submenu. If you would like to modify the post type settings you can use the menu_settings you can define the placement of your settings page. This will register a new post type with all the standard settings. Note that the WordPress_Plugin_Template() function name and the wordpress-plugin-template text domain will each be unique to your plugin after you have used the cloning script. WordPress_Plugin_Template()->register_post_type( 'listing', _( 'Listings', 'wordpress-plugin-template' ), _( 'Listing', 'wordpress-plugin-template' ) ) For example if you wanted to register a listing post type then you could do it like this: Using the post type API and the wrapper function from the main plugin class you can easily register new post types with one line of code. I will expand on these libraries in future versions.
![wordpress template wordpress template](https://wpuonline.com/wordpress-ecommerce-themes-free/imager_4356.jpg)
Initialise new git repo (y/n) - if you enter 'y' here then a git repo will be initialised in the new plugin folder.Īs of v3.0 of this template, there are a few libraries built into it that will make a number of common tasks a lot easier.
![wordpress template wordpress template](https://modernwebtemplates.com/wp-content/uploads/2017/05/02.1_home_cropped.jpg)
Wordpress template full#
Plugin name - this must be the full name of your plugin, with correct capitalisation and spacing.Once you start the script it will ask for three things: You can run the script just like you would run any shell script - it does not take any arguments, so you don't need to worry about that. You can simply copy the files out of this repo and rename everything as you need it, but to make things easier I have included a shell script in this repo that will automatically copy the files to a new folder, remove all traces of the existing git repo, rename everything in the files according to your new plugin name, and initialise a new git repo in the folder if you choose to do so. I use this template as a base for any plugin that I start building and I thought it might benefit more people if I shared it around. Why this template?Īfter writing many WordPress plugins I slowly developed my own coding style and way of doing things - this template is the culmination of what I've learnt along the way. A robust and GPL-licensed code template for creating a standards-compliant WordPress plugin.