Make WordPress Core


Ignore:
Timestamp:
02/13/2018 04:53:44 PM (8 years ago)
Author:
DrewAPicture
Message:

Docs: Link to the "Conditional Tags" article in the Theme Developer Handbook from the descriptions for a variety of core conditional tag functions.

These notations largely serve to direct consumers (of both the source and the parsed code reference) to extended information on individual and related conditional tags throughout WordPress. The changeset also standardizes corresponding DocBlock summaries to use third-person singular verbs.

Notations been added for the following functions:

  • comments_open()
  • email exists()
  • has_excerpt()
  • has_post_thumbnail()
  • has_tag()
  • in_category()
  • in_the_loop()
  • is_404()
  • is_active_sidebar()
  • is_active_widget()
  • is_admin()
  • is_admin_bar_showing()
  • is_archive()
  • is_attachment()
  • is_author()
  • is_blog_installed()
  • is_category()
  • is_comments_popup()
  • is_date()
  • is_day()
  • is_dynamic_sidebar()
  • is_feed()
  • is_front_page()
  • is_home()
  • is_local_attachment()
  • is_main_query
  • is_month()
  • is_multi_author
  • is_new_day()
  • is_page()
  • is_page_template()
  • is_paged()
  • is_plugin_active()
  • is_plugin_active_for_network()
  • is_plugin_inactive()
  • is_plugin_page()
  • is_post_type_archive()
  • is_preview()
  • is_rtl()
  • is_search()
  • is_single()
  • is_singular()
  • is_sticky()
  • is_tag()
  • is_tax()
  • is_taxonomy_hierarchical()
  • is_time()
  • is_trackback()
  • is_user_logged_in()
  • is_year()
  • pings_open()
  • post_type_exists()
  • taxonomy_exists()
  • term_exists()
  • username exists()
  • wp_attachment_is_image()
  • wp_script_is()

Props janalwin.
Fixes #43254.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/query.php

    r42588 r42710  
    137137
    138138/**
    139  * Is the query for an existing archive page?
     139 * Determines whether the query is for an existing archive page.
    140140 *
    141141 * Month, Year, Category, Author, Post Type archive...
    142  *
     142 *
     143 * For more information on this and similar theme functions, check out
     144 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
     145 * Conditional Tags} article in the Theme Developer Handbook.
     146 *
    143147 * @since 1.5.0
    144148 *
     
    159163
    160164/**
    161  * Is the query for an existing post type archive page?
    162  *
     165 * Determines whether the query is for an existing post type archive page.
     166 *
     167 * For more information on this and similar theme functions, check out
     168 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
     169 * Conditional Tags} article in the Theme Developer Handbook.
     170 *
    163171 * @since 3.1.0
    164172 *
     
    180188
    181189/**
    182  * Is the query for an existing attachment page?
    183  *
     190 * Determines whether the query is for an existing attachment page.
     191 *
     192 * For more information on this and similar theme functions, check out
     193 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
     194 * Conditional Tags} article in the Theme Developer Handbook.
     195 *
    184196 * @since 2.0.0
    185197 *
     
    201213
    202214/**
    203  * Is the query for an existing author archive page?
     215 * Determines whether the query is for an existing author archive page.
    204216 *
    205217 * If the $author parameter is specified, this function will additionally
    206218 * check if the query is for one of the authors specified.
    207  *
     219 *
     220 * For more information on this and similar theme functions, check out
     221 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
     222 * Conditional Tags} article in the Theme Developer Handbook.
     223 *
    208224 * @since 1.5.0
    209225 *
     
    225241
    226242/**
    227  * Is the query for an existing category archive page?
     243 * Determines whether the query is for an existing category archive page.
    228244 *
    229245 * If the $category parameter is specified, this function will additionally
    230246 * check if the query is for one of the categories specified.
    231  *
     247 *
     248 * For more information on this and similar theme functions, check out
     249 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
     250 * Conditional Tags} article in the Theme Developer Handbook.
     251 *
    232252 * @since 1.5.0
    233253 *
     
    249269
    250270/**
    251  * Is the query for an existing tag archive page?
     271 * Determines whether the query is for an existing tag archive page.
    252272 *
    253273 * If the $tag parameter is specified, this function will additionally
    254274 * check if the query is for one of the tags specified.
     275 *
     276 * For more information on this and similar theme functions, check out
     277 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
     278 * Conditional Tags} article in the Theme Developer Handbook.
    255279 *
    256280 * @since 2.3.0
     
    273297
    274298/**
    275  * Is the query for an existing custom taxonomy archive page?
     299 * Determines whether the query is for an existing custom taxonomy archive page.
    276300 *
    277301 * If the $taxonomy parameter is specified, this function will additionally
     
    281305 * this function will additionally check if the query is for one of the terms
    282306 * specified.
     307 *
     308 * For more information on this and similar theme functions, check out
     309 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
     310 * Conditional Tags} article in the Theme Developer Handbook.
    283311 *
    284312 * @since 2.5.0
     
    302330
    303331/**
    304  * Is the query for an existing date archive?
    305  *
     332 * Determines whether the query is for an existing date archive.
     333 *
     334 * For more information on this and similar theme functions, check out
     335 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
     336 * Conditional Tags} article in the Theme Developer Handbook.
     337 *
    306338 * @since 1.5.0
    307339 *
     
    322354
    323355/**
    324  * Is the query for an existing day archive?
     356 * Determines whether the query is for an existing day archive.
    325357 *
    326358 * A conditional check to test whether the page is a date-based archive page displaying posts for the current day.
    327  *
     359 *
     360 * For more information on this and similar theme functions, check out
     361 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
     362 * Conditional Tags} article in the Theme Developer Handbook.
     363 *
    328364 * @since 1.5.0
    329365 *
     
    344380
    345381/**
    346  * Is the query for a feed?
    347  *
     382 * Determines whether the query is for a feed.
     383 *
     384 * For more information on this and similar theme functions, check out
     385 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
     386 * Conditional Tags} article in the Theme Developer Handbook.
     387 *
    348388 * @since 1.5.0
    349389 *
     
    385425
    386426/**
    387  * Is the query for the front page of the site?
     427 * Determines whether the query is for the front page of the site.
    388428 *
    389429 * This is for what is displayed at your site's main URL.
     
    395435 *
    396436 * Otherwise the same as @see is_home()
    397  *
     437 *
     438 * For more information on this and similar theme functions, check out
     439 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
     440 * Conditional Tags} article in the Theme Developer Handbook.
     441 *
    398442 * @since 2.5.0
    399443 *
     
    414458
    415459/**
    416  * Determines if the query is for the blog homepage.
     460 * Determines whether the query is for the blog homepage.
    417461 *
    418462 * The blog homepage is the page that shows the time-based blog content of the site.
     
    423467 * If a static page is set for the front page of the site, this function will return true only
    424468 * on the page you set as the "Posts page".
    425  *
     469 *
     470 * For more information on this and similar theme functions, check out
     471 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
     472 * Conditional Tags} article in the Theme Developer Handbook.
     473 *
    426474 * @since 1.5.0
    427475 *
     
    443491
    444492/**
    445  * Is the query for an existing month archive?
    446  *
     493 * Determines whether the query is for an existing month archive.
     494 *
     495 * For more information on this and similar theme functions, check out
     496 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
     497 * Conditional Tags} article in the Theme Developer Handbook.
     498 *
    447499 * @since 1.5.0
    448500 *
     
    463515
    464516/**
    465  * Is the query for an existing single page?
     517 * Determines whether the query is for an existing single page.
    466518 *
    467519 * If the $page parameter is specified, this function will additionally
    468520 * check if the query is for one of the pages specified.
    469  *
     521 *
     522 * For more information on this and similar theme functions, check out
     523 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
     524 * Conditional Tags} article in the Theme Developer Handbook.
     525 *
    470526 * @see is_single()
    471527 * @see is_singular()
     
    490546
    491547/**
    492  * Is the query for paged result and not for the first page?
    493  *
     548 * Determines whether the query is for paged results and not for the first page.
     549 *
     550 * For more information on this and similar theme functions, check out
     551 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
     552 * Conditional Tags} article in the Theme Developer Handbook.
     553 *
    494554 * @since 1.5.0
    495555 *
     
    510570
    511571/**
    512  * Is the query for a post or page preview?
    513  *
     572 * Determines whether the query is for a post or page preview.
     573 *
     574 * For more information on this and similar theme functions, check out
     575 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
     576 * Conditional Tags} article in the Theme Developer Handbook.
     577 *
    514578 * @since 2.0.0
    515579 *
     
    550614
    551615/**
    552  * Is the query for a search?
    553  *
     616 * Determines whether the query is for a search.
     617 *
     618 * For more information on this and similar theme functions, check out
     619 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
     620 * Conditional Tags} article in the Theme Developer Handbook.
     621 *
    554622 * @since 1.5.0
    555623 *
     
    570638
    571639/**
    572  * Is the query for an existing single post?
     640 * Determines whether the query is for an existing single post.
    573641 *
    574642 * Works for any post type, except attachments and pages
     
    576644 * If the $post parameter is specified, this function will additionally
    577645 * check if the query is for one of the Posts specified.
    578  *
     646 *
     647 * For more information on this and similar theme functions, check out
     648 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
     649 * Conditional Tags} article in the Theme Developer Handbook.
     650 *
    579651 * @see is_page()
    580652 * @see is_singular()
     
    599671
    600672/**
    601  * Is the query for an existing single post of any post type (post, attachment, page,
    602  * custom post types)?
     673 * Determines whether the query is for an existing single post of any post type
     674 * (post, attachment, page, custom post types).
    603675 *
    604676 * If the $post_types parameter is specified, this function will additionally
    605677 * check if the query is for one of the Posts Types specified.
    606  *
     678 *
     679 * For more information on this and similar theme functions, check out
     680 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
     681 * Conditional Tags} article in the Theme Developer Handbook.
     682 *
    607683 * @see is_page()
    608684 * @see is_single()
     
    627703
    628704/**
    629  * Is the query for a specific time?
     705 * Determines whether the query is for a specific time.
     706 *
     707 * For more information on this and similar theme functions, check out
     708 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
     709 * Conditional Tags} article in the Theme Developer Handbook.
    630710 *
    631711 * @since 1.5.0
     
    647727
    648728/**
    649  * Is the query for a trackback endpoint call?
     729 * Determines whether the query is for a trackback endpoint call.
     730 *
     731 * For more information on this and similar theme functions, check out
     732 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
     733 * Conditional Tags} article in the Theme Developer Handbook.
    650734 *
    651735 * @since 1.5.0
     
    667751
    668752/**
    669  * Is the query for an existing year archive?
     753 * Determines whether the query is for an existing year archive.
     754 *
     755 * For more information on this and similar theme functions, check out
     756 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
     757 * Conditional Tags} article in the Theme Developer Handbook.
    670758 *
    671759 * @since 1.5.0
     
    687775
    688776/**
    689  * Is the query a 404 (returns no results)?
    690  *
     777 * Determines whether the query has resulted in a 404 (returns no results).
     778 *
     779 * For more information on this and similar theme functions, check out
     780 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
     781 * Conditional Tags} article in the Theme Developer Handbook.
     782 *
    691783 * @since 1.5.0
    692784 *
     
    727819
    728820/**
    729  * Is the query the main query?
    730  *
     821 * Determines whether the query is the main query.
     822 *
     823 * For more information on this and similar theme functions, check out
     824 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
     825 * Conditional Tags} article in the Theme Developer Handbook.
     826 *
    731827 * @since 3.3.0
    732828 *
     
    771867
    772868/**
    773  * Whether the caller is in the Loop.
     869 * Determines whether the caller is in the Loop.
     870 *
     871 * For more information on this and similar theme functions, check out
     872 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
     873 * Conditional Tags} article in the Theme Developer Handbook.
    774874 *
    775875 * @since 2.0.0
Note: See TracChangeset for help on using the changeset viewer.