views:

38

answers:

1

Is there a 'good working practise' way to modify the markup that a wordpress plugin produces without editing the plugin's core files. The problem i foresee is that when you update the plugin, the markup that you would have modified overwritten.

I know in drupal there are template overrides, but i don't know enough about wordpress to do a similar practise.

Any help?

A: 

The plugin itself would probably have to be written to allow for it (though see below). There are a few ways to do this: You could have the plugin look for template files that it pulls from an arbitrary location (e.g. "uploads/myplugin") You could possibly store the HTML in the database as a setting. The plugin could be written with an apply_filter hook (just as WordPress itself uses hooks) to allow outside calls that change output (e.g. from a separate plugin or a theme's functions.php). I've used all of these methods.

If you're talking about altering the output of somebody else's plugin, you could possibly ask them to implement one of the above. Push comes to shove you can use JavaScript to manipulate the DOM.

Strider