WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

WPSEO_Author_Sitemap_Provider::get_index_links() public Yoast 1.0

Get the links for the sitemap index.

{} Это метод класса: WPSEO_Author_Sitemap_Provider{}

Хуков нет.

Возвращает

Массив.

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

$WPSEO_Author_Sitemap_Provider = new WPSEO_Author_Sitemap_Provider();
$WPSEO_Author_Sitemap_Provider->get_index_links( $max_entries );
$max_entries(int) (обязательный)
Entries per sitemap.

Код WPSEO_Author_Sitemap_Provider::get_index_links() Yoast 17.2

public function get_index_links( $max_entries ) {

	if ( ! $this->handles_type( 'author' ) ) {
		return [];
	}

	// @todo Consider doing this less often / when necessary. R.
	$this->update_user_meta();

	$has_exclude_filter = has_filter( 'wpseo_sitemap_exclude_author' );

	$query_arguments = [];

	if ( ! $has_exclude_filter ) { // We only need full users if legacy filter(s) hooked to exclusion logic. R.
		$query_arguments['fields'] = 'ID';
	}

	$users = $this->get_users( $query_arguments );

	if ( $has_exclude_filter ) {
		$users = $this->exclude_users( $users );
		$users = wp_list_pluck( $users, 'ID' );
	}

	if ( empty( $users ) ) {
		return [];
	}

	$index      = [];
	$page       = 1;
	$user_pages = array_chunk( $users, $max_entries );

	if ( count( $user_pages ) === 1 ) {
		$page = '';
	}

	foreach ( $user_pages as $users_page ) {

		$user_id = array_shift( $users_page ); // Time descending, first user on page is most recently updated.
		$user    = get_user_by( 'id', $user_id );
		$index[] = [
			'loc'     => WPSEO_Sitemaps_Router::get_base_url( 'author-sitemap' . $page . '.xml' ),
			'lastmod' => ( $user->_yoast_wpseo_profile_updated ) ? YoastSEO()->helpers->date->format_timestamp( $user->_yoast_wpseo_profile_updated ) : null,
		];

		++$page;
	}

	return $index;
}