apply_filters( ‘wp_ability_validate_output’, true|WP_Error $is_valid, mixed $output, string $ability_name )

In this article

Filters the output validation result for an ability.

Description

Allows developers to add custom validation logic on top of the default JSON Schema validation. If default validation already failed, the filter receives the WP_Error object and can add additional error information or override it. If default validation passed, the filter can add additional validation checks and return a WP_Error if those checks fail.

Parameters

$is_validtrue|WP_Error
The validation result from default validation.
$outputmixed
The output data being validated.
$ability_namestring
The name of the ability.

Source

$validity = apply_filters( 'wp_ability_validate_output', $is_valid, $output, $this->name );

Changelog

VersionDescription
7.1.0Introduced.

User Contributed Notes

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