WP_CLI::merge_sub_commands()private staticWP-CLI 1.0

Merge the sub-commands of two commands into a single command to keep.

Метод класса: WP_CLI{}

No Hooks.

Return

null. Nothing.

Usage

$result = WP_CLI::merge_sub_commands(;

Код WP_CLI::merge_sub_commands() WP-CLI 2.7.0-alpha

private static function merge_sub_commands(
	CompositeCommand $command_to_keep,
	CompositeCommand $old_command,
	CompositeCommand $new_command
) {
	foreach ( $old_command->get_subcommands() as $subname => $subcommand ) {
		$command_to_keep->add_subcommand( $subname, $subcommand, false );
	}

	foreach ( $new_command->get_subcommands() as $subname => $subcommand ) {
		$command_to_keep->add_subcommand( $subname, $subcommand, true );
	}
}