WordPress.org

Ready to get started?Download WordPress

Forums

How to Filter a Plugin Function (3 posts)

  1. dharmashanti
    Member
    Posted 1 year ago #

    Occasionally, I use a plugin to add functionality to a site. But sometimes, the information outputted by a plugin function needs to be modified.

    For example, I was using the My Calendar plugin. Only problem was that the Previous/Next links were giving the incorrect URL. Rather than hack the plugin directly, I wanted to add a function to the theme's function.php file that would filter the output of the plugin function that creates the Previous/Next links.

    I tried using the name of the function as a hook, but that didn't seem to work. Is there a way to do this?

  2. s_ha_dum
    Member
    Posted 1 year ago #

    You can only use a filter or an action if the plugin author included one or more of them for you to use. look for do_action or apply_filters in the plugin source.

  3. Andrew Bartel
    Member
    Posted 1 year ago #

    Haven't ever looked at the code for the My Calendar plugin, but some developers are really good about making their code extendable and everything has hooks, others, not so much.

    Best of luck.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.