• Resolved Jer Clarke

    (@jeremyclarke)


    Hi again, can you tell I’m making good use of your plugin?

    I am trying to filter the plugin_url() response in your plugin to fix an issue in my server related to symbolic links and the CSS file. The problem is that because you run plugin_url() in the root (non-hooked) context of your plugin I am unable to filter the value using the normal ‘plugin_url’ filter (because my plugin hasn’t had a chance to register my filter yet).

    It seems that you foresaw this issue and added the ‘custom-metadata-manager-default-css’ filter to get around it. Am I right about that? It seems like you even tried to make your filter match the regular plugins_url one.

    If so I think you should consider moving the define(CUSTOM_METADATA_MANAGER_URL) call instead. By running that in your admin_init hook instead of the core of the plugin you allow other plugins a chance to register plugin_url filters before the constant is determined, which is much easier than asking them to have a custom filter just for your plugin.

    I tried it out and everything seems to still work fine with the define in the admin_init hook.

    Thanks!

    https://www.ads-software.com/extend/plugins/custom-metadata/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author cvernon

    (@cvernon)

    This seems reasonable to me. Will check with Mo to see if he sees any reason not to move the define() into admin_init.

    Thread Starter Jer Clarke

    (@jeremyclarke)

    FWIW after writing the report above I realized that Akismet makes the same mistake and causes the exact same problem for me (I need to figure out where is best to propose changes to Akismet).

    The only solution was to set up my filter in an mu-plugin instead of a normal plugin, that way it gets included before any other plugin files and thus the filter on plugin_url works.

    Still would be good for you (and Akismet) to make the change, as being able to filter that URL is vital for many setups.

    Thanks,

    Plugin Author Joey Kudish

    (@jkudish)

    Hey Jeremy,

    Sorry it took 4 months, but I’ve just made this change in our trunk. Will push this fix out in 0.5.2 along with a few other bug fixes.

    Cheers!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Custom Metadata Manager] Please make plugins_url filterable with usual filter’ is closed to new replies.