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

WPSEO_Sitemaps::build_sitemap() public Yoast 1.0

Attempts to build the requested sitemap.

Sets $bad_sitemap if this isn't for the root sitemap, a post type or taxonomy.

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

Возвращает

null. Ничего.

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

$WPSEO_Sitemaps = new WPSEO_Sitemaps();
$WPSEO_Sitemaps->build_sitemap( $type );
$type(строка) (обязательный)
The requested sitemap's identifier.

Код WPSEO_Sitemaps::build_sitemap() Yoast 17.2

public function build_sitemap( $type ) {

	/**
	 * Filter the type of sitemap to build.
	 *
	 * @param string $type Sitemap type, determined by the request.
	 */
	$type = apply_filters( 'wpseo_build_sitemap_post_type', $type );

	if ( $type === '1' ) {
		$this->build_root_map();

		return;
	}

	$entries_per_page = $this->get_entries_per_page();

	foreach ( $this->providers as $provider ) {
		if ( ! $provider->handles_type( $type ) ) {
			continue;
		}

		try {
			$links = $provider->get_sitemap_links( $type, $entries_per_page, $this->current_page );
		} catch ( OutOfBoundsException $exception ) {
			$this->bad_sitemap = true;

			return;
		}

		$this->sitemap = $this->renderer->get_sitemap( $links, $type, $this->current_page );

		return;
	}

	if ( has_action( 'wpseo_do_sitemap_' . $type ) ) {
		/**
		 * Fires custom handler, if hooked to generate sitemap for the type.
		 */
		do_action( 'wpseo_do_sitemap_' . $type );

		return;
	}

	$this->bad_sitemap = true;
}