beans_do_register_default_menu

Register default menu.

beans_do_register_default_menu( )

Return: (void)

Source

function beans_do_register_default_menu() {

	// Stop here if a menu already exists.
	if ( wp_get_nav_menus() ) {
		return;
	}

	$name = __( 'Navigation', 'tm-beans' );

	// Set up default menu if it doesn't exists.
	if ( ! wp_get_nav_menu_object( $name ) ) {
		wp_update_nav_menu_item(
			wp_create_nav_menu( $name ),
			0,
			array(
				'menu-item-title'   => __( 'Home', 'tm-beans' ),
				'menu-item-classes' => 'home',
				'menu-item-url'     => home_url( '/' ),
				'menu-item-status'  => 'publish',
			)
		);
	}

}