• Hi,

    I don’t use WordPress much, so please bear with me.

    After looking for a plugin for a feature I need available on my website, I came across one that suites my need, but the appearance on the front-end makes it look like the feature is an afterthought. An inline style tag was embedded into the HTML which would make customizing its appearance via CSS much more challenging than I should deal with.

    I know enough that I would be able to go in into the plugin folder and edit the code to remove the style tag and add Bootstrap classes, but I also know enough that is not ideal should the developers update the plugin.

    Would using hooks and filters allow me to edit the HTML output from the plugin, or do the developers need to provide functionality to be able to do so? And if possible via hooks and filters, is there a good tutorial to help me?

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    You’d need to find out what hooks/filters are available for the plugin. Check to see if it’s listed on hookr.io and also ask the plugin’s developers. They (hookr) also have a plugin to help you “look inside” a plugin: https://wordpress.org/plugins/wp-inspect/

    Thread Starter xamantha

    (@xamantha)

    Hi Steven,

    So if the developers didn’t provide the hooks and filters, then I am basically stuck with what I have or resort to editing the plugin?

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Perhaps. You might be able to do some “translation”. Ask the plugin dev.

    Thread Starter xamantha

    (@xamantha)

    Thanks for your help, Steven.

    An alternative may be avaliable. If this plugin is accessed by shortcodes, then you can effectively wrap you own code around it. You would register your own shortcode, your shortcode function would call the shortcode function of this troublesome plugin, capture its output and then filter that to remove its inline styling and put your own classes and id etc in place.

    Otherwise I would be making a copy of this plugin, change it to a new name and adjust the code to suit. Keep line by line before and after text of your edits so that if the plugin is updated you have an easy time re incorporating your changes.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Editing HTML output of a plugin’ is closed to new replies.