can I create my own pluggable functions?
-
Just like wordpress has pluggable functions, I’d like to create my own pluggable functions in my plugin. Essentially, I have a plugin with several different widgets, and I want the user to be able to customize these widgets (particularly, the ability to customize the look and feel of the widgets). However, I don’t want them to have to go through some sophisticated installation process where they copy template files over into their theme directory, or even worse, set things up such that they have to directly edit the plugin files.
For example, I’d like to have something like this:
if (!function_exists(“render_widget_html”)) {
function render_widget_html() {
echo “This is my widget!”;
}
}And allow the user to define a render_widget_html() function in their theme’s functions.php.
Any ideas?
Maybe there’s a better way to approach this problem?
- The topic ‘can I create my own pluggable functions?’ is closed to new replies.