Hey everyone!
I’d love to get some advice. Where’s the best place to begin learning Wordpress plugin development? I’ve been using Laravel and PHP for about a year, but I’m new to Wordpress and not sure where to start.
Any help would be great!
This is where I got started with plugins: GitHub - DevinVinson/WordPress-Plugin-Boilerplate: [WordPress] A foundation for WordPress Plugin Development that aims to provide a clear and consistent guide for building your plugins.
Also, check out the official plugin development guide from Wordpress: Plugin Handbook | Developer.WordPress.org
Once you get the hang of best practices and basic plugin structure, you’ll be ready to experiment. It’s super helpful to look at popular plugins and see how they’re built.
@Tan
I tried using that boilerplate for a project, but ran into an issue where a variable wasn’t namespaced properly. It caused a conflict with another plugin.
define( 'PLUGIN_VERSION', '1.0.0' );
Has anyone else faced this problem? I was surprised it wasn’t handled in the boilerplate.
@Chen
Yeah, that can happen if you don’t rename the constant to something unique. Try using a prefix like ‘MY_COOL_PLUGIN_VERSION’. That should avoid any conflicts.
If you think adding a better comment in the code would help, feel free to make a PR!
@Chen
I haven’t run into that yet. Maybe check the GitHub issues section? The dev team is pretty responsive.
@Tan
That’s super helpful, thank you!
Farrell said:
@Tan
That’s super helpful, thank you!
Boilerplates are great for learning since you can mess around with them and break things. I’d recommend trying out a few and experimenting. Once you feel confident, try building something from scratch. That’s when things really start to click.
Don’t stress too much about all the boilerplate stuff at first. If you’re just starting out, try making a simple plugin in a single file. Get it working, then improve it step by step.
Keelan said:
Don’t stress too much about all the boilerplate stuff at first. If you’re just starting out, try making a simple plugin in a single file. Get it working, then improve it step by step.
Good point. Starting simple is great, but I’d also suggest looking at some basic plugin structures early on so you get a sense of how things fit together. It helps avoid major rewrites later on.
Just a heads up… Wordpress is shifting from TinyMCE to Gutenberg as the main editor soon. That might change how some things work.
If you don’t have a specific project you need to finish right away, you might want to wait until things settle down.
@Zen
Yeah, I read about the switch to Vue or React. I already work with both, so adapting shouldn’t be too hard. I’m more interested in learning how plugins fit into the Wordpress system.
@Zen
Looks like the direction for Gutenberg is still up in the air for now.
Check out Traversy Media’s tutorials on YouTube: https://youtu.be/eZn3tfF5GFM
Winter said:
Check out Traversy Media’s tutorials on YouTube: https://youtu.be/eZn3tfF5GFM
That looks great, thanks!
Here’s a live example of where you could take things in the future: GitHub - DevinVinson/wppb-admin-page: Scaffolding out what a wppb rewrite could look like with a simple admin page. No WP standards used because I don't have a local setup that has IDE rules to keep me inline with WP standards at the moment.
If you’re familiar with modern workflows, it should be pretty easy to follow.
Also, I’ve got a plugin using ES6, React, and Webpack that I plan to turn into a proper boilerplate when I get the time.
@Roux
Hey, I’m in Florida too! Thanks for your boilerplate, it’s been super useful. I’ve extended it in a bunch of ways for different projects.
Check out Lynda.com.
They have a ‘Wordpress Developer’ path and a bunch of plugin courses. I learned a lot from their classes.
They have a ‘Wordpress Developer’ path and a bunch of plugin courses. I learned a lot from their classes.
Why the downvotes? Just trying to help.
Try looking at the code of different plugins every day. Even after you’ve gained some experience, it’s a great way to keep learning.