Support » Plugins » Unable to Remove Action from Hook

  • Resolved slbasso


    I added an action called “add_aiesec_pages” to the hook “admin_menu” with the call:

    add_action(“admin_menu”, “add_aiesec_pages”);

    However, when I try to remove the action with the call:

    remove_action(“admin_menu”, “add_aiesec_pages”);

    it will not remove it. I know this because when a delete my function “add_aiesec_pages”, WordPress complains.

    In order to see what was going on with the actions/filters, I added the following line just before the call_user_fun_array call in the do_action function of plugin.php.

    echo “<b>”, $tag, ‘ ‘, $priority, ‘ ‘, $function_name, “</b><br>”;

    The output of it is:

    sanitize_comment_cookies 10 sanitize_comment_cookies
    init 10 wp_cron
    init 10 kses_init
    set_current_user 10 kses_init
    admin_menu 10 aiesec_menu
    admin_menu 10 add_aiesec_pages
    admin_menu 10 kubrick_add_theme_page
    admin_print_scripts 20 wp_print_scripts

    I want to remove the sixth action listed here.

    Any help would be great. Thanks.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Unable to Remove Action from Hook’ is closed to new replies.