PHP Class Menu_Location_Command, wp-cli

## EXAMPLES # List available menu locations $ wp menu location list +----------+-------------------+ | location | description | +----------+-------------------+ | primary | Primary Menu | | social | Social Links Menu | +----------+-------------------+ # Assign the 'primary-menu' menu to the 'primary' location $ wp menu location assign primary-menu primary Success: Assigned location to menu. # Remove the 'primary-menu' menu from the 'primary' location $ wp menu location remove primary-menu primary Success: Removed location from menu.
Inheritance: extends WP_CLI_Command
显示文件 Open project: wp-cli/wp-cli

Public Methods

Method Description
assign ( $args, $_ ) Assign a location to a menu.
list_ ( $_, $assoc_args ) List locations for the current theme.
remove ( $args, $_ ) Remove a location from a menu.

Method Details

assign() public method

## OPTIONS : The name, slug, or term ID for the menu. : Location's slug. ## EXAMPLES $ wp menu location assign primary-menu primary Success: Assigned location to menu.
public assign ( $args, $_ )

list_() public method

## OPTIONS [--format=] : Render output in a particular format. --- default: table options: - table - csv - json - count - yaml - ids --- ## AVAILABLE FIELDS These fields will be displayed by default for each location: * name * description ## EXAMPLES $ wp menu location list +----------+-------------------+ | location | description | +----------+-------------------+ | primary | Primary Menu | | social | Social Links Menu | +----------+-------------------+
public list_ ( $_, $assoc_args )

remove() public method

## OPTIONS : The name, slug, or term ID for the menu. : Location's slug. ## EXAMPLES $ wp menu location remove primary-menu primary Success: Removed location from menu.
public remove ( $args, $_ )