WordPress.org

Make WordPress Core

Changeset 45739


Ignore:
Timestamp:
08/04/2019 01:58:03 AM (3 months ago)
Author:
SergeyBiryukov
Message:

Docs: Add missing description for $wp_query and $wp_the_query globals.

Props mukesh27.
See #45604, #47110.

Location:
trunk/src
Files:
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-media-list-table.php

    r45617 r45739  
    6262
    6363    /**
    64      * @global WP_Query $wp_query
     64     * @global WP_Query $wp_query              WordPress Query object.
    6565     * @global array    $post_mime_types
    6666     * @global array    $avail_post_mime_types
  • trunk/src/wp-admin/includes/class-wp-posts-list-table.php

    r45734 r45739  
    137137    /**
    138138     * @global array    $avail_post_stati
    139      * @global WP_Query $wp_query
     139     * @global WP_Query $wp_query         WordPress Query object.
    140140     * @global int      $per_page
    141141     * @global string   $mode
     
    696696
    697697    /**
    698      * @global WP_Query $wp_query
     698     * @global WP_Query $wp_query WordPress Query object.
    699699     * @global int $per_page
    700700     * @param array $posts
  • trunk/src/wp-admin/includes/export.php

    r45723 r45739  
    526526    if ( $post_ids ) {
    527527        /**
    528          * @global WP_Query $wp_query
     528         * @global WP_Query $wp_query WordPress Query object.
    529529         */
    530530        global $wp_query;
  • trunk/src/wp-admin/includes/media.php

    r45737 r45739  
    14161416 * @since 2.5.0
    14171417 *
    1418  * @global WP_Query $wp_the_query
     1418 * @global WP_Query $wp_the_query WordPress Query object.
    14191419 *
    14201420 * @param int $post_id Optional. Post ID.
     
    25282528 *
    25292529 * @global wpdb      $wpdb            WordPress database abstraction object.
    2530  * @global WP_Query  $wp_query
     2530 * @global WP_Query  $wp_query        WordPress Query object.
    25312531 * @global WP_Locale $wp_locale       WordPress date and time locale object.
    25322532 * @global string    $type
  • trunk/src/wp-includes/admin-bar.php

    r45590 r45739  
    677677 *
    678678 * @global WP_Term  $tag
    679  * @global WP_Query $wp_the_query
     679 * @global WP_Query $wp_the_query WordPress Query object.
    680680 * @global int      $user_id      The ID of the user being edited. Not to be confused with the
    681681 *                                global $user_ID, which contains the ID of the current user.
  • trunk/src/wp-includes/canonical.php

    r45735 r45739  
    3030 *
    3131 * @global WP_Rewrite $wp_rewrite WordPress rewrite component.
    32  * @global bool $is_IIS
    33  * @global WP_Query $wp_query
    34  * @global wpdb $wpdb             WordPress database abstraction object.
    35  * @global WP $wp                 Current WordPress environment instance.
     32 * @global bool       $is_IIS
     33 * @global WP_Query   $wp_query   WordPress Query object.
     34 * @global wpdb       $wpdb       WordPress database abstraction object.
     35 * @global WP         $wp         Current WordPress environment instance.
    3636 *
    3737 * @param string $requested_url Optional. The URL that was requested, used to
  • trunk/src/wp-includes/class-wp-query.php

    r45674 r45739  
    41624162     * @since 3.3.0
    41634163     *
    4164      * @global WP_Query $wp_query Global WP_Query instance.
     4164     * @global WP_Query $wp_query WordPress Query object.
    41654165     *
    41664166     * @return bool
  • trunk/src/wp-includes/class-wp.php

    r45735 r45739  
    561561     * @since 2.0.0
    562562     *
    563      * @global WP_Query     $wp_query
     563     * @global WP_Query     $wp_query     WordPress Query object.
    564564     * @global string       $query_string Query string for the loop.
    565      * @global array        $posts The found posts.
    566      * @global WP_Post|null $post The current post, if available.
    567      * @global string       $request The SQL statement for the request.
    568      * @global int          $more Only set, if single page or post.
    569      * @global int          $single If single page or post. Only set, if single page or post.
    570      * @global WP_User      $authordata Only set, if author archive.
     565     * @global array        $posts        The found posts.
     566     * @global WP_Post|null $post         The current post, if available.
     567     * @global string       $request      The SQL statement for the request.
     568     * @global int          $more         Only set, if single page or post.
     569     * @global int          $single       If single page or post. Only set, if single page or post.
     570     * @global WP_User      $authordata   Only set, if author archive.
    571571     */
    572572    public function register_globals() {
     
    607607     * @since 2.0.0
    608608     *
    609      * @global WP_Query $wp_the_query
     609     * @global WP_Query $wp_the_query WordPress Query object.
    610610     */
    611611    public function query_posts() {
     
    630630     * @since 2.0.0
    631631     *
    632      * @global WP_Query $wp_query
     632     * @global WP_Query $wp_query WordPress Query object.
    633633     */
    634634    public function handle_404() {
  • trunk/src/wp-includes/comment-template.php

    r45735 r45739  
    13031303 * @since 1.5.0
    13041304 *
    1305  * @global WP_Query   $wp_query
     1305 * @global WP_Query   $wp_query         WordPress Query object.
    13061306 * @global WP_Post    $post
    13071307 * @global wpdb       $wpdb             WordPress database abstraction object.
     
    19601960 * @see WP_Query->comments
    19611961 *
    1962  * @global WP_Query $wp_query
     1962 * @global WP_Query $wp_query           WordPress Query object.
    19631963 * @global int      $comment_alt
    19641964 * @global int      $comment_depth
  • trunk/src/wp-includes/comment.php

    r45674 r45739  
    965965 * @uses Walker_Comment
    966966 *
    967  * @global WP_Query $wp_query
     967 * @global WP_Query $wp_query WordPress Query object.
    968968 *
    969969 * @param WP_Comment[] $comments Optional. Array of WP_Comment objects. Defaults to $wp_query->comments.
  • trunk/src/wp-includes/feed.php

    r45611 r45739  
    638638}
    639639
    640 /*
     640/**
    641641 * Get the timestamp of the most recently modified post from WP_Query.
    642642 *
     
    644644 * comment will be returned.
    645645 *
    646  * @global WP_Query  $wp_query The global WP_Query object.
     646 * @global WP_Query $wp_query WordPress Query object.
    647647 *
    648648 * @since 5.2.0
  • trunk/src/wp-includes/functions.php

    r45737 r45739  
    11141114 *
    11151115 * @global WP       $wp           Current WordPress environment instance.
    1116  * @global WP_Query $wp_query
    1117  * @global WP_Query $wp_the_query
     1116 * @global WP_Query $wp_query     WordPress Query object.
     1117 * @global WP_Query $wp_the_query Copy of the WordPress Query object.
    11181118 *
    11191119 * @param string|array $query_vars Default WP_Query arguments.
     
    13791379 * @since 2.1.0
    13801380 *
    1381  * @global WP_Query $wp_query Used to tell if the use a comment feed.
     1381 * @global WP_Query $wp_query WordPress Query object.
    13821382 */
    13831383function do_feed() {
     
    29672967 * @since 5.1.0 The `$link_url`, `$link_text`, and `$exit` arguments were added.
    29682968 *
    2969  * @global WP_Query $wp_query Global WP_Query instance.
     2969 * @global WP_Query $wp_query WordPress Query object.
    29702970 *
    29712971 * @param string|WP_Error  $message Optional. Error message. If this is a WP_Error object,
  • trunk/src/wp-includes/general-template.php

    r45737 r45739  
    39263926 * @since 4.9.0 Added the `aria_current` argument.
    39273927 *
    3928  * @global WP_Query   $wp_query
     3928 * @global WP_Query   $wp_query   WordPress Query object.
    39293929 * @global WP_Rewrite $wp_rewrite WordPress rewrite component.
    39303930 *
  • trunk/src/wp-includes/link-template.php

    r45735 r45739  
    23232323 *
    23242324 * @global int      $paged
    2325  * @global WP_Query $wp_query
     2325 * @global WP_Query $wp_query WordPress Query object.
    23262326 *
    23272327 * @param string $label    Content for link text.
     
    24612461 * @since 2.8.0
    24622462 *
    2463  * @global WP_Query $wp_query
     2463 * @global WP_Query $wp_query WordPress Query object.
    24642464 *
    24652465 * @param string|array $args {
     
    28022802 * @since 2.7.1
    28032803 *
    2804  * @global WP_Query $wp_query
     2804 * @global WP_Query $wp_query WordPress Query object.
    28052805 *
    28062806 * @param string $label    Optional. Label for link text. Default empty.
  • trunk/src/wp-includes/nav-menu-template.php

    r45735 r45739  
    295295 * @since 3.0.0
    296296 *
    297  * @global WP_Query   $wp_query
     297 * @global WP_Query   $wp_query   WordPress Query object.
    298298 * @global WP_Rewrite $wp_rewrite WordPress rewrite component.
    299299 *
  • trunk/src/wp-includes/post-template.php

    r45735 r45739  
    608608 * @since 2.8.0
    609609 *
    610  * @global WP_Query $wp_query
     610 * @global WP_Query $wp_query WordPress Query object.
    611611 *
    612612 * @param string|string[] $class Space-separated string or array of class names to add to the class list.
     
    12341234 * @see get_pages()
    12351235 *
    1236  * @global WP_Query $wp_query
     1236 * @global WP_Query $wp_query WordPress Query object.
    12371237 *
    12381238 * @param array|string $args {
  • trunk/src/wp-includes/post-thumbnail-template.php

    r45590 r45739  
    8484 * @since 3.2.0
    8585 *
    86  * @global WP_Query $wp_query
     86 * @global WP_Query $wp_query WordPress Query object.
    8787 *
    8888 * @param WP_Query $wp_query Optional. A WP_Query instance. Defaults to the $wp_query global.
  • trunk/src/wp-includes/query.php

    r45674 r45739  
    1818 * @since 3.9.0 The `$default` argument was introduced.
    1919 *
    20  * @global WP_Query $wp_query Global WP_Query instance.
     20 * @global WP_Query $wp_query WordPress Query object.
    2121 *
    2222 * @param string $var       The variable key to retrieve.
     
    3636 * @since 3.1.0
    3737 *
    38  * @global WP_Query $wp_query Global WP_Query instance.
     38 * @global WP_Query $wp_query WordPress Query object.
    3939 *
    4040 * @return object Queried object.
     
    5252 * @since 3.1.0
    5353 *
    54  * @global WP_Query $wp_query Global WP_Query instance.
     54 * @global WP_Query $wp_query WordPress Query object.
    5555 *
    5656 * @return int ID of the queried object.
     
    6666 * @since 2.2.0
    6767 *
    68  * @global WP_Query $wp_query Global WP_Query instance.
     68 * @global WP_Query $wp_query WordPress Query object.
    6969 *
    7070 * @param string $var   Query variable key.
     
    8989 * @since 1.5.0
    9090 *
    91  * @global WP_Query $wp_query Global WP_Query instance.
     91 * @global WP_Query $wp_query WordPress Query object.
    9292 *
    9393 * @param array|string $query Array or string of WP_Query arguments.
     
    108108 * @since 2.3.0
    109109 *
    110  * @global WP_Query $wp_query     Global WP_Query instance.
     110 * @global WP_Query $wp_query     WordPress Query object.
    111111 * @global WP_Query $wp_the_query Copy of the global WP_Query instance created during wp_reset_query().
    112112 */
     
    122122 * @since 3.0.0
    123123 *
    124  * @global WP_Query $wp_query Global WP_Query instance.
     124 * @global WP_Query $wp_query WordPress Query object.
    125125 */
    126126function wp_reset_postdata() {
     
    147147 * @since 1.5.0
    148148 *
    149  * @global WP_Query $wp_query Global WP_Query instance.
     149 * @global WP_Query $wp_query WordPress Query object.
    150150 *
    151151 * @return bool
     
    171171 * @since 3.1.0
    172172 *
    173  * @global WP_Query $wp_query Global WP_Query instance.
     173 * @global WP_Query $wp_query WordPress Query object.
    174174 *
    175175 * @param string|array $post_types Optional. Post type or array of posts types to check against.
     
    196196 * @since 2.0.0
    197197 *
    198  * @global WP_Query $wp_query Global WP_Query instance.
     198 * @global WP_Query $wp_query WordPress Query object.
    199199 *
    200200 * @param int|string|array|object $attachment Attachment ID, title, slug, or array of such.
     
    224224 * @since 1.5.0
    225225 *
    226  * @global WP_Query $wp_query Global WP_Query instance.
     226 * @global WP_Query $wp_query WordPress Query object.
    227227 *
    228228 * @param mixed $author Optional. User ID, nickname, nicename, or array of User IDs, nicknames, and nicenames
     
    252252 * @since 1.5.0
    253253 *
    254  * @global WP_Query $wp_query Global WP_Query instance.
     254 * @global WP_Query $wp_query WordPress Query object.
    255255 *
    256256 * @param mixed $category Optional. Category ID, name, slug, or array of Category IDs, names, and slugs.
     
    280280 * @since 2.3.0
    281281 *
    282  * @global WP_Query $wp_query Global WP_Query instance.
     282 * @global WP_Query $wp_query WordPress Query object.
    283283 *
    284284 * @param mixed $tag Optional. Tag ID, name, slug, or array of Tag IDs, names, and slugs.
     
    312312 * @since 2.5.0
    313313 *
    314  * @global WP_Query $wp_query Global WP_Query instance.
     314 * @global WP_Query $wp_query WordPress Query object.
    315315 *
    316316 * @param string|array     $taxonomy Optional. Taxonomy slug or slugs.
     
    338338 * @since 1.5.0
    339339 *
    340  * @global WP_Query $wp_query Global WP_Query instance.
     340 * @global WP_Query $wp_query WordPress Query object.
    341341 *
    342342 * @return bool
     
    364364 * @since 1.5.0
    365365 *
    366  * @global WP_Query $wp_query Global WP_Query instance.
     366 * @global WP_Query $wp_query WordPress Query object.
    367367 *
    368368 * @return bool
     
    388388 * @since 1.5.0
    389389 *
    390  * @global WP_Query $wp_query Global WP_Query instance.
     390 * @global WP_Query $wp_query WordPress Query object.
    391391 *
    392392 * @param string|array $feeds Optional feed types to check.
     
    409409 * @since 3.0.0
    410410 *
    411  * @global WP_Query $wp_query Global WP_Query instance.
     411 * @global WP_Query $wp_query WordPress Query object.
    412412 *
    413413 * @return bool
     
    442442 * @since 2.5.0
    443443 *
    444  * @global WP_Query $wp_query Global WP_Query instance.
     444 * @global WP_Query $wp_query WordPress Query object.
    445445 *
    446446 * @return bool True, if front of site.
     
    475475 *
    476476 * @see is_front_page()
    477  * @global WP_Query $wp_query Global WP_Query instance.
     477 * @global WP_Query $wp_query WordPress Query object.
    478478 *
    479479 * @return bool True if blog view homepage, otherwise false.
     
    505505 * @since 5.2.0
    506506 *
    507  * @global WP_Query $wp_query Global WP_Query instance.
     507 * @global WP_Query $wp_query WordPress Query object.
    508508 *
    509509 * @return bool
     
    529529 * @since 1.5.0
    530530 *
    531  * @global WP_Query $wp_query Global WP_Query instance.
     531 * @global WP_Query $wp_query WordPress Query object.
    532532 *
    533533 * @return bool
     
    559559 * @since 1.5.0
    560560 *
    561  * @global WP_Query $wp_query Global WP_Query instance.
     561 * @global WP_Query $wp_query WordPress Query object.
    562562 *
    563563 * @param int|string|array $page Optional. Page ID, title, slug, or array of such. Default empty.
     
    584584 * @since 1.5.0
    585585 *
    586  * @global WP_Query $wp_query Global WP_Query instance.
     586 * @global WP_Query $wp_query WordPress Query object.
    587587 *
    588588 * @return bool
     
    608608 * @since 2.0.0
    609609 *
    610  * @global WP_Query $wp_query Global WP_Query instance.
     610 * @global WP_Query $wp_query WordPress Query object.
    611611 *
    612612 * @return bool
     
    628628 * @since 2.1.0
    629629 *
    630  * @global WP_Query $wp_query Global WP_Query instance.
     630 * @global WP_Query $wp_query WordPress Query object.
    631631 *
    632632 * @return bool
     
    652652 * @since 1.5.0
    653653 *
    654  * @global WP_Query $wp_query Global WP_Query instance.
     654 * @global WP_Query $wp_query WordPress Query object.
    655655 *
    656656 * @return bool
     
    684684 * @since 1.5.0
    685685 *
    686  * @global WP_Query $wp_query Global WP_Query instance.
     686 * @global WP_Query $wp_query WordPress Query object.
    687687 *
    688688 * @param int|string|array $post Optional. Post ID, title, slug, or array of such. Default empty.
     
    716716 * @since 1.5.0
    717717 *
    718  * @global WP_Query $wp_query Global WP_Query instance.
     718 * @global WP_Query $wp_query WordPress Query object.
    719719 *
    720720 * @param string|array $post_types Optional. Post type or array of post types. Default empty.
     
    741741 * @since 1.5.0
    742742 *
    743  * @global WP_Query $wp_query Global WP_Query instance.
     743 * @global WP_Query $wp_query WordPress Query object.
    744744 *
    745745 * @return bool
     
    765765 * @since 1.5.0
    766766 *
    767  * @global WP_Query $wp_query Global WP_Query instance.
     767 * @global WP_Query $wp_query WordPress Query object.
    768768 *
    769769 * @return bool
     
    789789 * @since 1.5.0
    790790 *
    791  * @global WP_Query $wp_query Global WP_Query instance.
     791 * @global WP_Query $wp_query WordPress Query object.
    792792 *
    793793 * @return bool
     
    813813 * @since 1.5.0
    814814 *
    815  * @global WP_Query $wp_query Global WP_Query instance.
     815 * @global WP_Query $wp_query WordPress Query object.
    816816 *
    817817 * @return bool
     
    833833 * @since 4.4.0
    834834 *
    835  * @global WP_Query $wp_query Global WP_Query instance.
     835 * @global WP_Query $wp_query WordPress Query object.
    836836 *
    837837 * @return bool Whether we're in an embedded post or not.
     
    857857 * @since 3.3.0
    858858 *
    859  * @global WP_Query $wp_query Global WP_Query instance.
     859 * @global WP_Query $wp_query WordPress Query object.
    860860 *
    861861 * @return bool
     
    887887 * @since 1.5.0
    888888 *
    889  * @global WP_Query $wp_query Global WP_Query instance.
     889 * @global WP_Query $wp_query WordPress Query object.
    890890 *
    891891 * @return bool
     
    905905 * @since 2.0.0
    906906 *
    907  * @global WP_Query $wp_query Global WP_Query instance.
     907 * @global WP_Query $wp_query WordPress Query object.
    908908 *
    909909 * @return bool True if caller is within loop, false if loop hasn't started or ended.
     
    919919 * @since 1.5.0
    920920 *
    921  * @global WP_Query $wp_query Global WP_Query instance.
     921 * @global WP_Query $wp_query WordPress Query object.
    922922 */
    923923function rewind_posts() {
     
    931931 * @since 1.5.0
    932932 *
    933  * @global WP_Query $wp_query Global WP_Query instance.
     933 * @global WP_Query $wp_query WordPress Query object.
    934934 */
    935935function the_post() {
     
    947947 * @since 2.2.0
    948948 *
    949  * @global WP_Query $wp_query Global WP_Query instance.
     949 * @global WP_Query $wp_query WordPress Query object.
    950950 *
    951951 * @return bool
     
    961961 * @since 2.2.0
    962962 *
    963  * @global WP_Query $wp_query Global WP_Query instance.
     963 * @global WP_Query $wp_query WordPress Query object.
    964964 *
    965965 * @return object
     
    11281128 * @since 4.4.0 Added the ability to pass a post ID to `$post`.
    11291129 *
    1130  * @global WP_Query $wp_query Global WP_Query instance.
     1130 * @global WP_Query $wp_query WordPress Query object.
    11311131 *
    11321132 * @param WP_Post|object|int $post WP_Post instance or Post ID/object.
     
    11481148 * @since 5.2.0
    11491149 *
    1150  * @global WP_Query $wp_query Global WP_Query instance.
     1150 * @global WP_Query $wp_query WordPress Query object.
    11511151 *
    11521152 * @param WP_Post|object|int $post WP_Post instance or Post ID/object.
  • trunk/src/wp-includes/template.php

    r45736 r45739  
    687687 * @global WP_Post    $post
    688688 * @global bool       $wp_did_header
    689  * @global WP_Query   $wp_query
     689 * @global WP_Query   $wp_query      WordPress Query object.
    690690 * @global WP_Rewrite $wp_rewrite    WordPress rewrite component.
    691691 * @global wpdb       $wpdb          WordPress database abstraction object.
  • trunk/src/wp-settings.php

    r45737 r45739  
    407407 * WordPress Query object
    408408 *
    409  * @global WP_Query $wp_the_query
     409 * @global WP_Query $wp_the_query WordPress Query object.
    410410 * @since 2.0.0
    411411 */
     
    416416 * Use this global for WordPress queries
    417417 *
    418  * @global WP_Query $wp_query
     418 * @global WP_Query $wp_query WordPress Query object.
    419419 * @since 1.5.0
    420420 */
Note: See TracChangeset for help on using the changeset viewer.