Sunday 25 June 2017

5 Ways to Make your WordPress Plugin Really Extensible


Creating a WordPress plugin can be really fun but you might create a plugin that other developers can’t extend. There will be clients that need something slightly different that you have made. Create extensible plugins so that other developers can jump in and add their own features. In this article, we will go through five ways which you can use today to make your plugin extensible. 1. Using Theme Support Feature
What is a theme support feature? When you create a theme, you must define that your theme supports a feature. This feature can be the featured image. Adding theme support is done by the theme and you can read more about that function add_theme_support here.
But how to use that within a plugin?
Have you ever had a project where you just wanted to remove some of the styles from a plugin? And for some reason, that was not possible, right? Well, you can make that possible within your plugin!
We can decide to enqueue our style only if the current theme does not support our plugin styles. If the theme was made with our plugin in made and has the necessary styles defined, the theme could have something like this in their code:
But this won’t do any good if we don’t
Source: https://managewp.org/articles/15405/5-ways-to-make-your-wordpress-plugin-really-extensible




source https://williechiu40.wordpress.com/2017/06/25/5-ways-to-make-your-wordpress-plugin-really-extensible/

No comments:

Post a Comment