Gets the classic menu assigned to the primary
navigation menu location if it exists.
Source
private static function get_nav_menu_at_primary_location() {
$locations = get_nav_menu_locations();
if ( isset( $locations['primary'] ) ) {
$primary_menu = wp_get_nav_menu_object( $locations['primary'] );
if ( $primary_menu ) {
return $primary_menu;
}
}
return null;
}
Changelog
Version | Description |
---|---|
6.3.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.