I'm using a third-party plugin that has an function hooked to the plugins_loaded hook. From the plugin file itself:

add_action('plugins_loaded', 'acf_qtranslate_monkey_patch', 3);

This is not in a class. This function is causing a few PHP notices, so I wanted to remove the action, but it's failing to. I've tried this in my functions.php:

function my_remove_action() {
    remove_action('plugins_loaded', 'acf_qtranslate_monkey_patch', 3);
add_action('setup_theme','my_remove_action'); // This action happens *after* plugins_loaded

I've also tried hooking it to plugins_loaded as well and just putting it straight into functions without hooking it to any action, but neither worked. What am I missing?

  • Have you tried to not hook in any action, just using remove_action('plugins_loaded', 'acf_qtranslate_monkey_patch', 3); in your fundtions.php file? – cybmeta Feb 9 '15 at 13:14
  • Yes, I tried that as well. I've edited the question above to clarify. – Dre Feb 9 '15 at 13:43
  • try adding priority to your add_action as 4th. – shyammakwana.me Feb 9 '15 at 13:46
  • add_action('plugins_loaded','my_remove_action', 4); – shyammakwana.me Feb 9 '15 at 13:46
  • @ShyamMakwana.me Thanks for the suggestion, but it didn't work. – Dre Feb 9 '15 at 13:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.