wppaste
WordPress

apply_filters( 'wp_sitemaps_posts_query_args', array $args, string $post_type )

Since
5.5.0, 6.1.0
Filters the query arguments for post type sitemap queries.

Compatibility

WordPress
since 6.1.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Parameters

$argsarray
Array of WP_Query arguments.
$post_typestring
Post type name.

Where this hook fires · 1

  • wp-includes/sitemaps/providers/class-wp-sitemaps-posts.php:237WP_Sitemaps_Posts::get_posts_query_args()

Source code

		 * @since 5.5.0		 * @since 6.1.0 Added `ignore_sticky_posts` default parameter.		 *		 * @param array  $args      Array of WP_Query arguments.		 * @param string $post_type Post type name.		 */		$args = apply_filters(			'wp_sitemaps_posts_query_args',			array(				'orderby'                => 'ID',				'order'                  => 'ASC',				'post_type'              => $post_type,				'posts_per_page'         => wp_sitemaps_get_max_urls( $this->object_type ),

Changelog

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.

6.1.0
Added ignore_sticky_posts default parameter.from the docblock
5.5.0
Introduced.from the docblock

About this page

Parsed data
Generated from the wordpress-develop 7.1.0 tag, 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.