wppaste
WordPress

WP_Sitemaps_Provider::get_sitemap_entries(): array[]

Since
5.5.0
Source
wp-includes/sitemaps/class-wp-sitemaps-provider.php:106
Lists sitemap pages exposed by this provider.

Description

The returned data is used to populate the sitemap entries of the index.

Return

array[]
Array of sitemap entries.

Hooks fired · 1

One hook fires while WP_Sitemaps_Provider::get_sitemap_entries() runs, in this order:

  1. apply_filters( wp_sitemaps_index_entry )filterline 128 (+22 into the body)

    Filters the sitemap entry for the sitemap index.

Uses · 3

Source

	public function get_sitemap_entries() {		$sitemaps = array(); 		$sitemap_types = $this->get_sitemap_type_data(); 		foreach ( $sitemap_types as $type ) {			for ( $page = 1; $page <= $type['pages']; $page++ ) {				$sitemap_entry = array(					'loc' => $this->get_sitemap_url( $type['name'], $page ),				); 				/**				 * Filters the sitemap entry for the sitemap index.				 *				 * @since 5.5.0				 *				 * @param array  $sitemap_entry  Sitemap entry for the post.				 * @param string $object_type    Object empty name.				 * @param string $object_subtype Object subtype name.				 *                               Empty string if the object type does not support subtypes.				 * @param int    $page           Page number of results.				 */				$sitemap_entry = apply_filters( 'wp_sitemaps_index_entry', $sitemap_entry, $this->object_type, $type['name'], $page ); 				$sitemaps[] = $sitemap_entry;			}		} 		return $sitemaps;	}

History

Introduced in 5.5.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.1.0 tag, from src/wp-includes/sitemaps/class-wp-sitemaps-provider.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.