Yoast\WP\SEO\Schema_Aggregator\Domain

Indexable_Count{}Yoast 1.0

Class to contain the count of indexables for a specific post type.

Хуков нет.

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

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

Методы

  1. public __construct( string $post_type, int $count )
  2. public get_count()
  3. public get_post_type()

Код Indexable_Count{} Yoast 27.7

class Indexable_Count {

	/**
	 * The count of indexables.
	 *
	 * @var int
	 */
	private $count;

	/**
	 * The post type.
	 *
	 * @var string
	 */
	private $post_type;

	/**
	 * Constructor for Indexable_Count.
	 *
	 * @param string $post_type The post type.
	 * @param int    $count     The count of indexables.
	 */
	public function __construct( string $post_type, int $count ) {
		$this->post_type = $post_type;
		$this->count     = $count;
	}

	/**
	 * Gets the count of indexables.
	 *
	 * @return int The count of indexables.
	 */
	public function get_count(): int {
		return $this->count;
	}

	/**
	 * Gets the post type.
	 *
	 * @return string The post type.
	 */
	public function get_post_type(): string {
		return $this->post_type;
	}
}