WP_Ability::do_executeprotectedWP 6.9.0

Executes the ability callback.

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

Хуков нет.

Возвращает

Разное|WP_Error. The result of the ability execution, or WP_Error on failure.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->do_execute( $input );
$input(разное)
The input data for the ability.
По умолчанию: null

Список изменений

С версии 6.9.0 Введена.

Код WP_Ability::do_execute() WP 7.0.2

protected function do_execute( $input = null ) {
	if ( ! is_callable( $this->execute_callback ) ) {
		return new WP_Error(
			'ability_invalid_execute_callback',
			/* translators: %s ability name. */
			sprintf( __( 'Ability "%s" does not have a valid execute callback.' ), esc_html( $this->name ) )
		);
	}

	return $this->invoke_callback( $this->execute_callback, $input );
}