WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Unable to Remove Action from Hook (2 posts)

  1. slbasso
    Member
    Posted 7 years ago #

    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.

  2. slbasso
    Member
    Posted 7 years ago #

    I'm stupid.

Topic Closed

This topic has been closed to new replies.

About this Topic