Getting an Array for a nav menu by creating a new plugin
-
hey, could someone help me, please? I’m stuck and I don’t know what I did wrong.
Maybe someone could look into my code and explain what I have to change. Thank you in advance.
https://pastebin.com/yyxNEjzC/* Plugin Name: Omaha Plugin URI: https://URI_Of_Page_Describing_Plugin_and_Updates Description: A brief description of the Plugin. Version: 1.0 Author: unk Author URI: https://URI_Of_The_Plugin_Author License: A "Slug" license name e.g. GPL2 */ function register_omaha_menu() { register_nav_menu('omahamenu',__( 'Omaha Menu' )); } add_action( 'init', 'register_omaha_menu' ); add_action( 'wp_footer', 'get_link_to_pages' ); function get_link_to_pages() { wp_nav_menu(array( 'menu' => 'omahamenu') ); // THIS IS WORKING. OUTPUT: Omaha Menu wp_nav_menu('omahamenu); // THIS IS WORKING. OUTPUT: Omaha Menu $menu = wp_get_nav_menu_items('Omaha Menu'); // NOT WORKING. Why? OUTPUT: false var_dump($menu); // NOT WORKING. Why? OUTPUT: false var_dump(wp_get_nav_menu_items('omahamenu')); // NOT WORKING. Why? OUTPUT: false }
I want to get an array with the Omaha Menu. How to do that?
- The topic ‘Getting an Array for a nav menu by creating a new plugin’ is closed to new replies.