WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

CLI_Alias_Command::delete() public WP-CLI 1.0

Deletes an alias.

OPTIONS

<key>
Key for the alias.
[--config=<config>]
Config file to be considered for operations.
--- options:
  • global
  • project

EXAMPLES

# Delete alias.
$ wp cli alias delete @prod
Success: Deleted '@prod' alias.
# Delete project alias.
$ wp cli alias delete @prod --config=project
Success: Deleted '@prod' alias.

{} Это метод класса: CLI_Alias_Command{}

Хуков нет.

Возвращает

null. Ничего.

Использование

$CLI_Alias_Command = new CLI_Alias_Command();
$CLI_Alias_Command->delete( $args, $assoc_args );
$args (обязательный)
-
$assoc_args (обязательный)
-

Код CLI_Alias_Command::delete() WP-CLI 2.5.0

public function delete( $args, $assoc_args ) {

	list( $alias ) = $args;

	$config = ( ! empty( $assoc_args['config'] ) ? $assoc_args['config'] : '' );

	list( $config_path, $aliases ) = $this->get_aliases_data( $config, $alias );

	$this->validate_config_file( $config_path );

	if ( empty( $aliases[ $alias ] ) ) {
		WP_CLI::error( "No alias found with key '{$alias}'." );
	}

	unset( $aliases[ $alias ] );
	$this->process_aliases( $aliases, $alias, $config_path, 'Deleted' );

}