Server IP : 172.67.157.199 / Your IP : 3.135.215.96 [ Web Server : Apache System : Linux b70eb322-3aee-0c53-7c82-0db91281f2c6.secureserver.net 6.1.90-1.el9.elrepo.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 2 12:09:22 EDT 2024 x86_64 User : root ( 0) PHP Version : 8.0.30.2 Disable Function : NONE Domains : 0 Domains MySQL : ON | cURL : ON | WGET : ON | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/wp-content/plugins/wordpress-seo/src/editors/application/seo/ |
Upload File : |
<?php // phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong namespace Yoast\WP\SEO\Editors\Application\Seo; use WP_Term; use Yoast\WP\SEO\Editors\Framework\Seo\Terms\Abstract_Term_Seo_Data_Provider; /** * The repository to get term related SEO data. * * @makePublic */ class Term_Seo_Information_Repository { /** * The term. * * @var WP_Term $term */ private $term; /** * The data providers. * * @var Abstract_Term_Seo_Data_Provider $seo_data_providers */ private $seo_data_providers; /** * The constructor. * * @param Abstract_Term_Seo_Data_Provider ...$seo_data_providers The providers. */ public function __construct( Abstract_Term_Seo_Data_Provider ...$seo_data_providers ) { $this->seo_data_providers = $seo_data_providers; } /** * The term. * * @param WP_Term $term The term. * * @return void */ public function set_term( WP_Term $term ): void { $this->term = $term; } /** * Method to return the compiled SEO data. * * @return array<string> The specific seo data. */ public function get_seo_data(): array { $array = []; foreach ( $this->seo_data_providers as $data_provider ) { $data_provider->set_term( $this->term ); $array = \array_merge( $array, $data_provider->get_data()->to_legacy_array() ); } return $array; } }