PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / trunk
Yoast SEO – Advanced SEO with real-time guidance and built-in AI vtrunk
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
← All changes | src/routes/yoast-head-rest-field.php +5 -7 18.2 → trunk View file →
@@ -1,5 +1,5 @@
1 -<?php // @phpcs:ignore Yoast.Files.FileName.InvalidClassFileName -- reason: this explicitly concerns the Yoast head fields.
1 +<?php // phpcs:ignore Yoast.Files.FileName.InvalidClassFileName -- Reason: this explicitly concerns the Yoast head fields.
2 2
3 3 namespace Yoast\WP\SEO\Routes;
4 4
5 5 use Yoast\WP\SEO\Actions\Indexables\Indexable_Head_Action;
@@ -12,10 +12,8 @@
12 12 * Yoast_Head_REST_Field class.
13 13 *
14 14 * Registers the yoast head REST field.
15 15 * Not technically a route but behaves the same so is included here.
16 - *
17 - * @phpcs:ignore Yoast.NamingConventions.ObjectNameDepth.MaxExceeded
18 16 */
19 17 class Yoast_Head_REST_Field implements Route_Interface {
20 18
21 19 /**
@@ -22,9 +20,9 @@
22 20 * The name of the Yoast head field.
23 21 *
24 22 * @var string
25 23 */
26 - const YOAST_HEAD_ATTRIBUTE_NAME = 'yoast_head';
24 + public const YOAST_HEAD_ATTRIBUTE_NAME = 'yoast_head';
27 25
28 26 /**
29 27 * The name of the Yoast head JSON field.
30 28 *
@@ -29,9 +27,9 @@
29 27 * The name of the Yoast head JSON field.
30 28 *
31 29 * @var string
32 30 */
33 - const YOAST_JSON_HEAD_ATTRIBUTE_NAME = 'yoast_head_json';
31 + public const YOAST_JSON_HEAD_ATTRIBUTE_NAME = 'yoast_head_json';
34 32
35 33 /**
36 34 * The post type helper.
37 35 *
@@ -94,15 +92,15 @@
94 92 *
95 93 * @return void
96 94 */
97 95 public function register_routes() {
98 - $public_post_types = $this->post_type_helper->get_public_post_types();
96 + $public_post_types = $this->post_type_helper->get_indexable_post_types();
99 97
100 98 foreach ( $public_post_types as $post_type ) {
101 99 $this->register_rest_fields( $post_type, 'for_post' );
102 100 }
103 101
104 - $public_taxonomies = $this->taxonomy_helper->get_public_taxonomies();
102 + $public_taxonomies = $this->taxonomy_helper->get_indexable_taxonomies();
105 103
106 104 foreach ( $public_taxonomies as $taxonomy ) {
107 105 if ( $taxonomy === 'post_tag' ) {
108 106 $taxonomy = 'tag';