Best option to allow for overriding of a plugin function
-
Hi,
I’m writing my first WP plugin and have got it to the stage where I want to provide end users with the ability to extend two of my plugins features.
The first is to inject extra values into an Array which is used to populate a html select element.
The second, is to allow for a end user to override an internal method with their own method. The method in question processes images, with a range of options. I imagine that an end user might want to either replace or augment the image processing options.
I’ve looked at do_action and add_filter. But am wondering whats the best approach?
For instance, if I use apply_filters on the return of my image processing function do I then use my own internal add_action to call that same method, or is there some mechanism for checking if a method has an override?
The pluggin is OOP, but I don’t think most users would want to extend the plugins classes.
- The topic ‘Best option to allow for overriding of a plugin function’ is closed to new replies.