ACF\AI\Abilities

ACF_REST_Ability{}ACF 1.0└─ WP_Ability

ACF REST Ability

Custom ability class that extends WP_Ability to skip output validation. This is needed because REST API schemas don't always match Abilities API schemas exactly, but we want to proxy directly to REST API endpoints.

No Hooks.

Usage

$ACF_REST_Ability = new ACF_REST_Ability();
// use class methods

Methods

  1. protected validate_output( $output )

ACF_REST_Ability{} code ACF 6.8.8

class ACF_REST_Ability extends WP_Ability {

	/**
	 * Override validate_output to always return true.
	 *
	 * Since we're proxying to WordPress REST API endpoints that have their own
	 * validation, we trust their output and skip Abilities API output validation.
	 *
	 * @since 6.8.0
	 *
	 * @param mixed $output The output to validate.
	 * @return true Always returns true to skip validation.
	 */
	protected function validate_output( $output ) {
		return true;
	}
}