wp_create_nav_menu

Advertisement

Summery Summery

Creates a navigation menu.

Syntax Syntax

wp_create_nav_menu( string $menu_name )

Description Description

Note that $menu_name is expected to be pre-slashed.

Parameters Parameters

$menu_name

(Required) Menu name.

Return Return

(int|WP_Error) Menu ID on success, WP_Error object on failure.

Source Source

File: wp-includes/nav-menu.php

 */
function wp_create_nav_menu( $menu_name ) {
	// expected_slashed ($menu_name)
	return wp_update_nav_menu_object( 0, array( 'menu-name' => $menu_name ) );

Advertisement

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.

Advertisement

Leave a Reply