Yoast\WP\SEO\Alerts\Infrastructure\Default_SEO_Data

Default_SEO_Data_Collector{}Yoast 1.0

Class that collects default SEO data.

Хуков нет.

Использование

$Default_SEO_Data_Collector = new Default_SEO_Data_Collector();
// use class methods

Методы

  1. public __construct( Options_Helper $options_helper )
  2. public get_posts_with_default_seo_description()
  3. public get_posts_with_default_seo_title()

Код Default_SEO_Data_Collector{} Yoast 28.3

class Default_SEO_Data_Collector {

	/**
	 * Holds the Options_Helper instance.
	 *
	 * @var Options_Helper
	 */
	private $options_helper;

	/**
	 * The constructor.
	 *
	 * @param Options_Helper $options_helper The options helper.
	 */
	public function __construct( Options_Helper $options_helper ) {
		$this->options_helper = $options_helper;
	}

	/**
	 * Returns the posts with default SEO title in their most recent.
	 *
	 * @return string[] The posts with default SEO title in their most recent.
	 */
	public function get_posts_with_default_seo_title(): array {
		return $this->options_helper->get( 'default_seo_title', [] );
	}

	/**
	 * Returns the posts with default SEO description in their most recent.
	 *
	 * @return string[] The posts with default SEO description in their most recent.
	 */
	public function get_posts_with_default_seo_description(): array {
		return $this->options_helper->get( 'default_seo_meta_desc', [] );
	}
}