PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 18.5
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v18.5
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
wordpress-seo / src / routes / supported-features-route.php

supported-features-route.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI 18.5, at src/routes/supported-features-route.php

60 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Yoast\WP\SEO\Routes;
4
5 use WP_REST_Response;
6 use Yoast\WP\SEO\Conditionals\Addon_Installation_Conditional;
7 use Yoast\WP\SEO\Main;
8
9 /**
10 * Supported_Features_Route class.
11 */
12 class Supported_Features_Route implements Route_Interface {
13
14 /**
15 * Represents the supported features route.
16 *
17 * @var string
18 */
19 const SUPPORTED_FEATURES_ROUTE = '/supported-features';
20
21 /**
22 * Returns the conditionals based in which this loadable should be active.
23 *
24 * @return array
25 */
26 public static function get_conditionals() {
27 return [
28 Addon_Installation_Conditional::class,
29 ];
30 }
31
32 /**
33 * Registers routes with WordPress.
34 *
35 * @return void
36 */
37 public function register_routes() {
38 $supported_features_route = [
39 'methods' => 'GET',
40 'callback' => [ $this, 'get_supported_features' ],
41 'permission_callback' => '__return_true',
42 ];
43
44 \register_rest_route( Main::API_V1_NAMESPACE, self::SUPPORTED_FEATURES_ROUTE, $supported_features_route );
45 }
46
47 /**
48 * Returns a list of features supported by this yoast seo installation.
49 *
50 * @return WP_REST_Response a list of features supported by this yoast seo installation.
51 */
52 public function get_supported_features() {
53 return new WP_REST_Response(
54 [
55 'addon-installation' => 1,
56 ]
57 );
58 }
59 }
60