WP_Query::is_main_query() public WP 3.3.0
Is the query the main query?
{} Это метод класса: WP_Query{}
Хуков нет.
Возвращает
true/false. Whether the query is the main query.
Использование
global $wp_query; $wp_query->is_main_query();
Заметки
- Global. WP_Query. $wp_query WordPress Query object.
Список изменений
С версии 3.3.0 | Введена. |
Код WP_Query::is_main_query() WP Query::is main query WP 5.6.2
public function is_main_query() {
global $wp_the_query;
return $wp_the_query === $this;
}