Get menus created with menu editor?

Maybe this helps : function get_all_wordpress_menus(){ return get_terms( ‘nav_menu’, array( ‘hide_empty’ => true ) ); } get_registered_nav_menus only gets the theme’s menu’s and not the clients menu’s. Source : Paulund This returns all ID’s. To get the name you can use : <?php $nav_menu = wp_get_nav_menu_object(ID comes here); echo $nav_menu->name; ?> All menu objects have … Read more

replace existing menu programtically

Add this code to functions.php of your current theme ( preferably child theme ): $menuName=”Your menu name”; $locationID = ‘primary’; $myMenu = get_term_by(‘name’, $menuName, ‘nav_menu’); $locations = get_theme_mod(‘nav_menu_locations’); if($myMenu->term_id !== $locations[$locationID]) { $locations[$locationID] = $myMenu->term_id; set_theme_mod(‘nav_menu_locations’, $locations); } Remember to change values of first two variables to match your requirements.

How to actually make menu walker alive on admin interface?

You use the walker in your theme, wherever you call your nav menu. So for example, if you currently have a “topnav” menu in your theme, like this: wp_nav_menu(array(‘menu’ => ‘topnav’); and your custom walker is called “myCustomWalker”, you would update the wp_nav_menu call like this: wp_nav_menu( array( ‘menu’ => ‘topnav’, ‘walker’ => new myCustomWalker() … Read more

edit user menu item

You can use this function <?php get_edit_user_link( $user_id ) ?> Read more: https://codex.wordpress.org/Function_Reference/get_edit_user_link Best regards,

Admin-ajax.php 500 error when Add to menu is clicked in admin

If you have problem with: POST wp-admin/admin-ajax.php 500 in WP define( ‘WP_MAX_MEMORY_LIMIT’, ‘512M’ ); in wp-config.php max_input_vars = 6000 ; in php.ini and deactivate all plugins and active one by one until you see which plugin is causing problem. (Ps. have the great chance to be the Yoast SEO plugin the problem)

how to display a specific wordpress menu?

Register your navigation menu Add this code to your functions.php file. function my_custom_new_menu() { register_nav_menu(‘my-custom-menu’,__( ‘My Custom Menu’ )); } add_action( ‘init’, ‘my_custom_new_menu’ ); Create new menu You can now go to Appearance » Menus page in your WordPress admin and try to create or edit a new menu. You will see ‘My Custom Menu’ … Read more

How to truncate menu label in wordpress?

Looks like the filter nav_menu_item_title is what you’re after. Here’s an example to use that to truncate the title to 10 characters. This is untested, but should do what you want, added to e.g. your functions.php function filter_nav_menu_item_title( $title, $item, $args, $depth ) { $truncLength = 10; if (strlen($title) > $truncLength) { return substr($title, 0, … Read more