WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Changing default wp_nav_menu arguments? (3 posts)

  1. Fusiondevs
    Member
    Posted 1 year ago #

    Hello everyone,

    I have been searching for this for days without any luck.. hopefully someone can help me here.

    Im building a plugin that modifies the way the nav menu is shown. I need to use a custom walker, but since this is a plugin, i want it to work out of the box. I dont want users to have to be editing their theme files to change the walker argument. So, my question is: is there any way to change the default walker being used by wp_nav_menu ,. or maybe a filter to call a custom wp_nav_menu with the new walker?

    Thanks in advance,
    Bruno

    PS: i misposted this on the plugins forum. Hopefully someone can delete it from there?

    [moderator note - yep, got it - all gone :) ]

  2. bcworkz
    Member
    Posted 1 year ago #

    wp_nav_menu() has a filter 'wp_nav_menu_args' in which you can replace the current walker argument or supply one if it does not exist.

  3. Fusiondevs
    Member
    Posted 1 year ago #

    That worked like a charm. Thank you.

Topic Closed

This topic has been closed to new replies.

About this Topic