WP_Ability::do_execute( mixed $input = null ): mixed|WP_Error

In this article

Executes the ability callback.

Parameters

$inputmixedoptional
The input data for the ability.

Default:null

Return

mixed|WP_Error The result of the ability execution, or WP_Error on failure.

Source

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 );
}

Changelog

VersionDescription
6.9.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.