Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

For example I have "my-plugin" plugin created using class:

class My_Plugin {

    public function __construct() {

    }
    /**
     * Other code where I creating plugins admin pagec etc.
     */
}
new My_Plugin();

So basically functionality is simple - it creates its option pages in admin.

But I want to extend it. For example: one module for adding filter to the_content and second module for adding filter to the_title.

Yes, it is simple may be used in one plugin but this is just for example to understand how to make modular plugin using OOP.

So most idea is - user may download only needed part/module of plugin. So if he need only filtering title then he loading The_Title module.

So question is - how to develop this plugin modules using OOP in WordPress?

Maybe code classes that extend main class or additional classes for every module? If so, please, provide me some examples.

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.