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.
742* @since 7.1.0743*744* @param true|WP_Error$is_valid The validation result from default validation.745* @param mixed$output The output data being validated.746* @param string$ability_name The name of the ability.747*/748$validity=apply_filters('wp_ability_validate_output',$is_valid,$output,$this->name);749if(false===$validity){750returnnewWP_Error('ability_invalid_output',__('Invalid output.'));751}752if(is_wp_error($validity)&&$validity->has_errors()){753return$validity;754}
History
Introduced in 7.1.0.
Signature, return type and hooks compared across 1 parsed release.
About this page
Parsed data
Generated from the wordpress-develop 7.1.0 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.