PluginProbe ʕ •ᴥ•ʔ
Secure Custom Fields / trunk
Secure Custom Fields vtrunk
6.9.1 6.9.0 6.8.9 6.8.7 6.8.8 6.8.6 6.8.4 6.8.5 trunk 6.4.0-beta1 6.4.0-beta2 6.4.1 6.4.1-beta3 6.4.1-beta4 6.4.1-beta5 6.4.1-beta6 6.4.1-beta7 6.4.2 6.5.0 6.5.1 6.5.2 6.5.3 6.5.4 6.5.5 6.5.6 6.5.7 6.6.0 6.7.0 6.7.1 6.8.0 6.8.1 6.8.2 6.8.3
secure-custom-fields / src / AI / Abilities / SCF_REST_Ability.php
secure-custom-fields / src / AI / Abilities Last commit date
Abilities.php 2 months ago AbstractAbilityGroup.php 2 months ago FieldGroup.php 1 month ago PostType.php 2 months ago SCF_REST_Ability.php 2 months ago Taxonomy.php 1 month ago
SCF_REST_Ability.php
41 lines
1 <?php
2 /**
3 * ACF 6.8.0 feature port.
4 *
5 * @package wordpress/secure-custom-fields
6 */
7
8 // phpcs:disable -- Upstream ACF 6.8.0 feature-port files are kept close to source.
9
10 namespace SCF\AI\Abilities;
11
12 use WP_Ability;
13
14 // Exit if accessed directly.
15 defined( 'ABSPATH' ) || exit;
16
17 /**
18 * SCF REST Ability
19 *
20 * Custom ability class that extends WP_Ability to skip output validation.
21 * This is needed because REST API schemas don't always match Abilities API schemas exactly,
22 * but we want to proxy directly to REST API endpoints.
23 */
24 class SCF_REST_Ability extends WP_Ability {
25
26 /**
27 * Override validate_output to always return true.
28 *
29 * Since we're proxying to WordPress REST API endpoints that have their own
30 * validation, we trust their output and skip Abilities API output validation.
31 *
32 * @since 6.8.0
33 *
34 * @param mixed $output The output to validate.
35 * @return true Always returns true to skip validation.
36 */
37 protected function validate_output( $output ) {
38 return true;
39 }
40 }
41