[Support request] Problem with remove_action

Home Forums Support [Support request] Problem with remove_action

Home Forums Support Problem with remove_action

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2340797
    Marcel Kuhla

    Hey Guys,

    Based on your theme and premium plugin, I’m working on a refresh of our news site. I would have added the secondary menu via add_action to the inside of the primary menu, but I can’t get it removed afterward.

    I tried
    remove_action('generate_after_navigation', 'generate_add_secondary_navigation_after_header', 5);
    but for some reason it does nothing. I also tried generate_after_header because I thought that maybe both navigations hook the same, but it also doesn’t work.

    What am I doing wrong?

    Regards,

    Marcel

    #2340853
    Ying
    Staff
    Customer Support

    Hi Marcel,

    Try changing the 5 to 7, and changing generate_after_navigation to generate_after_header.

    #2340966
    Marcel Kuhla

    Hey Ying,

    thank you for the answer, it worked 🙂 But could you please explain to me why 5 doesn’t work?

    I was going through the files and thought that everything gets priority 10 so 5 and 7 are both lower.

    The WordPress docs aren’t really helpful in regards to that, but maybe you can give me an explanation that I can remember for the future 😅

    Regards,

    Marcel

    #2340982
    Ying
    Staff
    Customer Support

    But could you please explain to me why 5 doesn’t work?

    Because when we add the secondary navigation, we used 7 🙂

    You can find the original code below:
    https://github.com/tomusborne/gp-premium/blob/2189fbebd60573971b0739a98917b49ab26f550c/secondary-nav/functions/functions.php#L478

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.