хук-фильтр
since 5.5.0
wp_sitemaps_posts_query_args
Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.
Сигнатура
apply_filters( 'wp_sitemaps_posts_query_args', array $args, string $post_type )
Описание
См. также WP_Query: полный список аргументов.
Фильтруемое значение
Массив аргументов WP_Query.
Параметры
$args
array
обязательный
Массив аргументов WP_Query.
$post_type
string
обязательный
Имя типа записи.
Исходный код
wp-includes/sitemaps/providers/class-wp-sitemaps-posts.php:237
$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 ),
'post_status' => array( 'publish' ),
'no_found_rows' => true,
'update_post_term_cache' => false,
'update_post_meta_cache' => false,
'ignore_sticky_posts' => true, // Sticky posts will still appear, but they won't be moved to the front.
),
$post_type
);
История изменений
| Версия | Описание |
|---|---|
| 6.1.0 | Added ignore_sticky_posts default parameter. |
| 5.5.0 | Introduced. |

