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
wordpress-seo / src / editors / framework / seo / terms / abstract-term-seo-data-provider.php

abstract-term-seo-data-provider.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI trunk, at src/editors/framework/seo/terms/abstract-term-seo-data-provider.php

52 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 //phpcs:disable Yoast.NamingConventions.NamespaceName.MaxExceeded
4 namespace Yoast\WP\SEO\Editors\Framework\Seo\Terms;
5
6 use WP_Term;
7 use WPSEO_Options;
8 use Yoast\WP\SEO\Editors\Domain\Seo\Seo_Plugin_Data_Interface;
9
10 /**
11 * Abstract class for all term data providers.
12 */
13 abstract class Abstract_Term_Seo_Data_Provider {
14
15 /**
16 * The term the metabox formatter is for.
17 *
18 * @var WP_Term
19 */
20 protected $term;
21
22 /**
23 * The term.
24 *
25 * @param WP_Term $term The term.
26 *
27 * @return void
28 */
29 public function set_term( WP_Term $term ): void {
30 $this->term = $term;
31 }
32
33 /**
34 * Retrieves a template.
35 *
36 * @param string $template_option_name The name of the option in which the template you want to get is saved.
37 *
38 * @return string
39 */
40 protected function get_template( string $template_option_name ): string {
41 $needed_option = $template_option_name . '-tax-' . $this->term->taxonomy;
42 return WPSEO_Options::get( $needed_option, '' );
43 }
44
45 /**
46 * Method to return the compiled SEO data.
47 *
48 * @return Seo_Plugin_Data_Interface The specific seo data.
49 */
50 abstract public function get_data(): Seo_Plugin_Data_Interface;
51 }
52