wp_sitemaps_posts_query_args WordPress Filter Hook
The wp_sitemaps_posts_query_args hook allows you to modify the query args used to fetch posts for the sitemap. This can be useful if you want to exclude certain posts from the sitemap or change the order in which they appear.
apply_filters( 'wp_sitemaps_posts_query_args', array $args , string $post_type ) #
Filters the query arguments for post type sitemap queries.
Description
See also
- WP_Query: for a full list of arguments.
Parameters
- $args
(array)Array of WP_Query arguments.
- $post_type
(string)Post type name.
Source
File: wp-includes/sitemaps/providers/class-wp-sitemaps-posts.php
Changelog
Version | Description |
---|---|
5.5.0 | Introduced. |