| @@ -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'; |