is_comment_feed() WP 3.0.0
Проверяет, является ли запрос, страницей фида комментариев. Условные тег.
Использует глобальную переменную $wp_query.
Работает на основе метода WP_Query::is_comment_feed
1 раз = 0.000016с = очень быстро | 50000 раз = 0.02с = скорость света | PHP 7.1.2, WP 4.7.3
Хуков нет.
Возвращает
true/false. true, когда мы находимся на странице RSS или другой ленты комментариев.
Использование
if( is_comment_feed() ){ // страница фида комментариев. }
Заметки
- Global. WP_Query. $wp_query WordPress Query object.
Список изменений
С версии 3.0.0 | Введена. |
Код is_comment_feed() is comment feed WP 5.6
function is_comment_feed() {
global $wp_query;
if ( ! isset( $wp_query ) ) {
_doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1.0' );
return false;
}
return $wp_query->is_comment_feed();
}Cвязанные функции
Из метки: Условные теги (типов страниц и запросов)
- is_404()
- is_admin()
- is_archive()
- is_attachment()
- is_author()
- is_blog_admin()
- is_category()
- is_customize_preview()
- is_date()
- is_day()
- is_embed()
- is_feed()
Еще из метки: Условные теги (все)
- cat_is_ancestor_of()
- comments_open()
- email_exists()
- has_block()
- has_category()
- has_custom_header()
- has_excerpt()
- has_nav_menu()
- has_post_thumbnail()
- has_shortcode()
- has_tag()
- has_term()
- have_comments()
- have_posts()
- in_category()
- in_the_loop()
Еще из раздела: Комментарии
- cancel_comment_reply_link()
- comment_author_email_link()
- comment_form()
- comment_form_title()
- comment_id_fields()
- comment_text()
- comment_type()
- comments_link()
- comments_number()
- comments_popup_link()
- get_avatar()
- get_avatar_data()
- get_avatar_url()
- get_cancel_comment_reply_link()
- get_comment()
- get_comment_author_email()
- get_comment_pages_count()
- get_comment_reply_link()
- get_comment_text()
- get_comment_type()
- get_comments()
- get_comments_link()
- get_comments_number()
- get_comments_pagenum_link()
- get_edit_comment_link()
- get_next_comments_link()
- get_page_of_comment()
- get_previous_comments_link()
- get_the_comments_navigation()
- get_the_comments_pagination()
- next_comments_link()
- paginate_comments_links()
- previous_comments_link()
- sanitize_comment_cookies()
- the_comments_navigation()
- the_comments_pagination()
- wp_allow_comment()
- wp_count_comments()
- wp_delete_comment()
- wp_get_current_commenter()
- wp_handle_comment_submission()
- wp_insert_comment()
- wp_list_comments()
- wp_new_comment()
- wp_notify_moderator()
- wp_notify_postauthor()
- wp_set_comment_cookies()
- wp_set_comment_status()
- wp_spam_comment()
- wp_transition_comment_status()
- wp_update_comment()
- wp_update_comment_count()
Еще из тегов шаблона: Основные
- bloginfo()
- calendar_week_mod()
- get_archives_link()
- get_bloginfo()
- get_calendar()
- get_current_blog_id()
- get_footer()
- get_header()
- get_search_form()
- get_sidebar()