Yoast\WP\SEO\Schema_Aggregator\Infrastructure

Config::get_per_pagepublicYoast 1.0

Get default items per page

Метод класса: Config{}

Возвращает

int.

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

$Config = new Config();
$Config->get_per_page( $post_type ): int;
$post_type(строка) (обязательный)
The post type to determine the max page size for.

Код Config::get_per_page() Yoast 28.3

public function get_per_page( string $post_type ): int {
	/**
	 * Filter: 'wpseo_schema_aggregator_big_schema_post_types' Determines the list of post types we want to have a smaller per page count.
	 *
	 * @param bool $default_schema_post_types Determines the default list of big schema post types.
	 */
	$big_schema_post_types = \apply_filters( 'wpseo_schema_aggregator_big_schema_post_types', self::BIG_SCHEMA_POST_TYPES );
	if ( ! \is_array( $big_schema_post_types ) ) {
		$big_schema_post_types = self::BIG_SCHEMA_POST_TYPES;
	}

	$per_page = \in_array( $post_type, $big_schema_post_types, true ) ? $this->get_big_per_post_type() : $this->get_default_per_post_type();

	if ( $per_page > self::MAX_PER_PAGE ) {
		$per_page = self::MAX_PER_PAGE;
	}

	return $per_page;
}