Home › Forums › General Issues › get_field for a menu fails › Reply To: get_field for a menu fails
Ah, so if you’re passing the menu id, slug or name then you need to get the menu object yourself in your filter. https://codex.wordpress.org/Function_Reference/wp_get_nav_menu_object. WP is just passing back exactly what you pass in for $args
. My testing was done on a basic theme and the menu is called using wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu', 'menu_id' => 'primary-menu' ) );
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.