Make WordPress Core


Ignore:
Timestamp:
10/26/2018 01:23:29 AM (6 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 have 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()

Merges [42710] to the 5.0 branch.

Props janalwin.
Fixes #43254.

File:
1 edited

Legend:

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

    r43026 r43827  
    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.
     357 *
     358 * For more information on this and similar theme functions, check out
     359 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
     360 * Conditional Tags} article in the Theme Developer Handbook.
    325361 *
    326362 * @since 1.5.0
     
    342378
    343379/**
    344  * Is the query for a feed?
    345  *
     380 * Determines whether the query is for a feed.
     381 *
     382 * For more information on this and similar theme functions, check out
     383 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
     384 * Conditional Tags} article in the Theme Developer Handbook.
     385 *
    346386 * @since 1.5.0
    347387 *
     
    383423
    384424/**
    385  * Is the query for the front page of the site?
     425 * Determines whether the query is for the front page of the site.
    386426 *
    387427 * This is for what is displayed at your site's main URL.
     
    393433 *
    394434 * Otherwise the same as @see is_home()
    395  *
     435 *
     436 * For more information on this and similar theme functions, check out
     437 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
     438 * Conditional Tags} article in the Theme Developer Handbook.
     439 *
    396440 * @since 2.5.0
    397441 *
     
    412456
    413457/**
    414  * Determines if the query is for the blog homepage.
     458 * Determines whether the query is for the blog homepage.
    415459 *
    416460 * The blog homepage is the page that shows the time-based blog content of the site.
     
    421465 * If a static page is set for the front page of the site, this function will return true only
    422466 * on the page you set as the "Posts page".
    423  *
     467 *
     468 * For more information on this and similar theme functions, check out
     469 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
     470 * Conditional Tags} article in the Theme Developer Handbook.
     471 *
    424472 * @since 1.5.0
    425473 *
     
    441489
    442490/**
    443  * Is the query for an existing month archive?
    444  *
     491 * Determines whether the query is for an existing month archive.
     492 *
     493 * For more information on this and similar theme functions, check out
     494 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
     495 * Conditional Tags} article in the Theme Developer Handbook.
     496 *
    445497 * @since 1.5.0
    446498 *
     
    461513
    462514/**
    463  * Is the query for an existing single page?
     515 * Determines whether the query is for an existing single page.
    464516 *
    465517 * If the $page parameter is specified, this function will additionally
    466518 * check if the query is for one of the pages specified.
    467  *
     519 *
     520 * For more information on this and similar theme functions, check out
     521 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
     522 * Conditional Tags} article in the Theme Developer Handbook.
     523 *
    468524 * @see is_single()
    469525 * @see is_singular()
     
    488544
    489545/**
    490  * Is the query for paged result and not for the first page?
    491  *
     546 * Determines whether the query is for paged results and not for the first page.
     547 *
     548 * For more information on this and similar theme functions, check out
     549 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
     550 * Conditional Tags} article in the Theme Developer Handbook.
     551 *
    492552 * @since 1.5.0
    493553 *
     
    508568
    509569/**
    510  * Is the query for a post or page preview?
    511  *
     570 * Determines whether the query is for a post or page preview.
     571 *
     572 * For more information on this and similar theme functions, check out
     573 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
     574 * Conditional Tags} article in the Theme Developer Handbook.
     575 *
    512576 * @since 2.0.0
    513577 *
     
    548612
    549613/**
    550  * Is the query for a search?
    551  *
     614 * Determines whether the query is for a search.
     615 *
     616 * For more information on this and similar theme functions, check out
     617 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
     618 * Conditional Tags} article in the Theme Developer Handbook.
     619 *
    552620 * @since 1.5.0
    553621 *
     
    568636
    569637/**
    570  * Is the query for an existing single post?
     638 * Determines whether the query is for an existing single post.
    571639 *
    572640 * Works for any post type, except attachments and pages
     
    574642 * If the $post parameter is specified, this function will additionally
    575643 * check if the query is for one of the Posts specified.
    576  *
     644 *
     645 * For more information on this and similar theme functions, check out
     646 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
     647 * Conditional Tags} article in the Theme Developer Handbook.
     648 *
    577649 * @see is_page()
    578650 * @see is_singular()
     
    597669
    598670/**
    599  * Is the query for an existing single post of any post type (post, attachment, page,
    600  * custom post types)?
     671 * Determines whether the query is for an existing single post of any post type
     672 * (post, attachment, page, custom post types).
    601673 *
    602674 * If the $post_types parameter is specified, this function will additionally
    603675 * check if the query is for one of the Posts Types specified.
    604  *
     676 *
     677 * For more information on this and similar theme functions, check out
     678 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
     679 * Conditional Tags} article in the Theme Developer Handbook.
     680 *
    605681 * @see is_page()
    606682 * @see is_single()
     
    625701
    626702/**
    627  * Is the query for a specific time?
     703 * Determines whether the query is for a specific time.
     704 *
     705 * For more information on this and similar theme functions, check out
     706 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
     707 * Conditional Tags} article in the Theme Developer Handbook.
    628708 *
    629709 * @since 1.5.0
     
    645725
    646726/**
    647  * Is the query for a trackback endpoint call?
     727 * Determines whether the query is for a trackback endpoint call.
     728 *
     729 * For more information on this and similar theme functions, check out
     730 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
     731 * Conditional Tags} article in the Theme Developer Handbook.
    648732 *
    649733 * @since 1.5.0
     
    665749
    666750/**
    667  * Is the query for an existing year archive?
     751 * Determines whether the query is for an existing year archive.
     752 *
     753 * For more information on this and similar theme functions, check out
     754 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
     755 * Conditional Tags} article in the Theme Developer Handbook.
    668756 *
    669757 * @since 1.5.0
     
    685773
    686774/**
    687  * Is the query a 404 (returns no results)?
    688  *
     775 * Determines whether the query has resulted in a 404 (returns no results).
     776 *
     777 * For more information on this and similar theme functions, check out
     778 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
     779 * Conditional Tags} article in the Theme Developer Handbook.
     780 *
    689781 * @since 1.5.0
    690782 *
     
    725817
    726818/**
    727  * Is the query the main query?
    728  *
     819 * Determines whether the query is the main query.
     820 *
     821 * For more information on this and similar theme functions, check out
     822 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
     823 * Conditional Tags} article in the Theme Developer Handbook.
     824 *
    729825 * @since 3.3.0
    730826 *
     
    769865
    770866/**
    771  * Whether the caller is in the Loop.
     867 * Determines whether the caller is in the Loop.
     868 *
     869 * For more information on this and similar theme functions, check out
     870 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
     871 * Conditional Tags} article in the Theme Developer Handbook.
    772872 *
    773873 * @since 2.0.0
Note: See TracChangeset for help on using the changeset viewer.