How to display already created menus via php?

I found the solution. I had to do the following $args = array ( ‘theme_location’ => $short, ‘menu_id’ => $short, ‘menu_class’ => ‘menu’, ‘menu_id’=>$menu_id, ‘fallback_cb’ => false ); wp_nav_menu( $args); Theme location was the correct attribute.

if role is logged in then do something

Something like this would be more efficient. This is basic PHP by the way, not WP specific. function add_extra_item_to_nav_menu( $items, $args ) { $roles = [ ‘administrator’ => [ //Role – slug name ‘SCHOOL_NAME-A’, //url path – appended to the end ‘ADMIN’, // can be any name – appended to SHOP NOW button ], ‘ROLEABC’ … Read more