PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 28.4
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v28.4
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 / values / indexables / indexable-builder-versions.php

indexable-builder-versions.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI 28.4, at src/values/indexables/indexable-builder-versions.php

45 lines 1.4 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\Values\Indexables;
4
5 /**
6 * Class Indexable_Builder_Versions
7 */
8 class Indexable_Builder_Versions {
9
10 public const DEFAULT_INDEXABLE_BUILDER_VERSION = 1;
11
12 /**
13 * The list of indexable builder versions defined by Yoast SEO Free.
14 * If the key is not in this list, the indexable type will not be managed.
15 * These numbers should be increased if one of the builders implements a new feature.
16 *
17 * @var array
18 */
19 protected $indexable_builder_versions_by_type = [
20 'date-archive' => self::DEFAULT_INDEXABLE_BUILDER_VERSION,
21 'general' => self::DEFAULT_INDEXABLE_BUILDER_VERSION,
22 'home-page' => 2,
23 'post' => 2,
24 'post-type-archive' => 2,
25 'term' => 2,
26 'user' => 2,
27 'system-page' => self::DEFAULT_INDEXABLE_BUILDER_VERSION,
28 ];
29
30 /**
31 * Provides the most recent version number for an Indexable's object type.
32 *
33 * @param string $object_type The Indexable type for which you want to know the most recent version.
34 *
35 * @return int The most recent version number for the type, or 1 if the version doesn't exist.
36 */
37 public function get_latest_version_for_type( $object_type ) {
38 if ( ! \array_key_exists( $object_type, $this->indexable_builder_versions_by_type ) ) {
39 return self::DEFAULT_INDEXABLE_BUILDER_VERSION;
40 }
41
42 return $this->indexable_builder_versions_by_type[ $object_type ];
43 }
44 }
45