WP_REST_Menus_Controller::get_menu_auto_add() – Returns the value of a menu’s auto_add setting.

You appear to be a bot. Output may be restricted

Description

Returns the value of a menu's auto_add setting.

Usage

$bool = WP_REST_Menus_Controller::get_menu_auto_add( $menu_id );

Parameters

$menu_id
( int ) required – The menu id to query.

Returns

bool The value of auto_add.

Source

File name: wordpress/wp-includes/rest-api/endpoints/class-wp-rest-menus-controller.php


Lines:

1 to 6 of 6
  protected function get_menu_auto_add( $menu_id ) {
    $nav_menu_option = (array) get_option( 'nav_menu_options', array( 'auto_add' => array() ) );

    return in_array( $menu_id, $nav_menu_option['auto_add'], true );
  }
 

 View on GitHub View on Trac