Skip to content

Commit

Permalink
Docs: Add missing description for $wp_query and $wp_the_query glo…
Browse files Browse the repository at this point in the history
…bals.

Props mukesh27.
See #45604, #47110.

git-svn-id: https://develop.svn.wordpress.org/trunk@45739 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Aug 4, 2019
1 parent 5af994b commit d19f4d7
Show file tree
Hide file tree
Showing 20 changed files with 84 additions and 84 deletions.
2 changes: 1 addition & 1 deletion src/wp-admin/includes/class-wp-media-list-table.php
Expand Up @@ -61,7 +61,7 @@ public function ajax_user_can() {
}

/**
* @global WP_Query $wp_query
* @global WP_Query $wp_query WordPress Query object.
* @global array $post_mime_types
* @global array $avail_post_mime_types
* @global string $mode
Expand Down
4 changes: 2 additions & 2 deletions src/wp-admin/includes/class-wp-posts-list-table.php
Expand Up @@ -136,7 +136,7 @@ public function ajax_user_can() {

/**
* @global array $avail_post_stati
* @global WP_Query $wp_query
* @global WP_Query $wp_query WordPress Query object.
* @global int $per_page
* @global string $mode
*/
Expand Down Expand Up @@ -695,7 +695,7 @@ protected function get_sortable_columns() {
}

/**
* @global WP_Query $wp_query
* @global WP_Query $wp_query WordPress Query object.
* @global int $per_page
* @param array $posts
* @param int $level
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/includes/export.php
Expand Up @@ -525,7 +525,7 @@ function wxr_filter_postmeta( $return_me, $meta_key ) {
<?php
if ( $post_ids ) {
/**
* @global WP_Query $wp_query
* @global WP_Query $wp_query WordPress Query object.
*/
global $wp_query;

Expand Down
4 changes: 2 additions & 2 deletions src/wp-admin/includes/media.php
Expand Up @@ -1415,7 +1415,7 @@ function get_attachment_fields_to_edit( $post, $errors = null ) {
*
* @since 2.5.0
*
* @global WP_Query $wp_the_query
* @global WP_Query $wp_the_query WordPress Query object.
*
* @param int $post_id Optional. Post ID.
* @param array $errors Errors for attachment, if any.
Expand Down Expand Up @@ -2527,7 +2527,7 @@ function media_upload_gallery_form( $errors ) {
* @since 2.5.0
*
* @global wpdb $wpdb WordPress database abstraction object.
* @global WP_Query $wp_query
* @global WP_Query $wp_query WordPress Query object.
* @global WP_Locale $wp_locale WordPress date and time locale object.
* @global string $type
* @global string $tab
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/admin-bar.php
Expand Up @@ -676,7 +676,7 @@ function wp_admin_bar_shortlink_menu( $wp_admin_bar ) {
* @since 3.1.0
*
* @global WP_Term $tag
* @global WP_Query $wp_the_query
* @global WP_Query $wp_the_query WordPress Query object.
* @global int $user_id The ID of the user being edited. Not to be confused with the
* global $user_ID, which contains the ID of the current user.
*
Expand Down
8 changes: 4 additions & 4 deletions src/wp-includes/canonical.php
Expand Up @@ -29,10 +29,10 @@
* @since 2.3.0
*
* @global WP_Rewrite $wp_rewrite WordPress rewrite component.
* @global bool $is_IIS
* @global WP_Query $wp_query
* @global wpdb $wpdb WordPress database abstraction object.
* @global WP $wp Current WordPress environment instance.
* @global bool $is_IIS
* @global WP_Query $wp_query WordPress Query object.
* @global wpdb $wpdb WordPress database abstraction object.
* @global WP $wp Current WordPress environment instance.
*
* @param string $requested_url Optional. The URL that was requested, used to
* figure if redirect is needed.
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/class-wp-query.php
Expand Up @@ -4161,7 +4161,7 @@ public function is_embed() {
*
* @since 3.3.0
*
* @global WP_Query $wp_query Global WP_Query instance.
* @global WP_Query $wp_query WordPress Query object.
*
* @return bool
*/
Expand Down
18 changes: 9 additions & 9 deletions src/wp-includes/class-wp.php
Expand Up @@ -560,14 +560,14 @@ public function build_query_string() {
*
* @since 2.0.0
*
* @global WP_Query $wp_query
* @global WP_Query $wp_query WordPress Query object.
* @global string $query_string Query string for the loop.
* @global array $posts The found posts.
* @global WP_Post|null $post The current post, if available.
* @global string $request The SQL statement for the request.
* @global int $more Only set, if single page or post.
* @global int $single If single page or post. Only set, if single page or post.
* @global WP_User $authordata Only set, if author archive.
* @global array $posts The found posts.
* @global WP_Post|null $post The current post, if available.
* @global string $request The SQL statement for the request.
* @global int $more Only set, if single page or post.
* @global int $single If single page or post. Only set, if single page or post.
* @global WP_User $authordata Only set, if author archive.
*/
public function register_globals() {
global $wp_query;
Expand Down Expand Up @@ -606,7 +606,7 @@ public function init() {
*
* @since 2.0.0
*
* @global WP_Query $wp_the_query
* @global WP_Query $wp_the_query WordPress Query object.
*/
public function query_posts() {
global $wp_the_query;
Expand All @@ -629,7 +629,7 @@ public function query_posts() {
*
* @since 2.0.0
*
* @global WP_Query $wp_query
* @global WP_Query $wp_query WordPress Query object.
*/
public function handle_404() {
global $wp_query;
Expand Down
4 changes: 2 additions & 2 deletions src/wp-includes/comment-template.php
Expand Up @@ -1302,7 +1302,7 @@ function wp_comment_form_unfiltered_html_nonce() {
*
* @since 1.5.0
*
* @global WP_Query $wp_query
* @global WP_Query $wp_query WordPress Query object.
* @global WP_Post $post
* @global wpdb $wpdb WordPress database abstraction object.
* @global int $id
Expand Down Expand Up @@ -1959,7 +1959,7 @@ function comment_form_title( $noreplytext = false, $replytext = false, $linktopa
*
* @see WP_Query->comments
*
* @global WP_Query $wp_query
* @global WP_Query $wp_query WordPress Query object.
* @global int $comment_alt
* @global int $comment_depth
* @global int $comment_thread_alt
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/comment.php
Expand Up @@ -964,7 +964,7 @@ function separate_comments( &$comments ) {
*
* @uses Walker_Comment
*
* @global WP_Query $wp_query
* @global WP_Query $wp_query WordPress Query object.
*
* @param WP_Comment[] $comments Optional. Array of WP_Comment objects. Defaults to $wp_query->comments.
* @param int $per_page Optional. Comments per page.
Expand Down
4 changes: 2 additions & 2 deletions src/wp-includes/feed.php
Expand Up @@ -637,13 +637,13 @@ function self_link() {
echo esc_url( apply_filters( 'self_link', set_url_scheme( 'http://' . $host['host'] . wp_unslash( $_SERVER['REQUEST_URI'] ) ) ) );
}

/*
/**
* Get the timestamp of the most recently modified post from WP_Query.
*
* If viewing a comment feed, the timestamp of the most recently modified
* comment will be returned.
*
* @global WP_Query $wp_query The global WP_Query object.
* @global WP_Query $wp_query WordPress Query object.
*
* @since 5.2.0
*
Expand Down
8 changes: 4 additions & 4 deletions src/wp-includes/functions.php
Expand Up @@ -1113,8 +1113,8 @@ function wp_remote_fopen( $uri ) {
* @since 2.0.0
*
* @global WP $wp Current WordPress environment instance.
* @global WP_Query $wp_query
* @global WP_Query $wp_the_query
* @global WP_Query $wp_query WordPress Query object.
* @global WP_Query $wp_the_query Copy of the WordPress Query object.
*
* @param string|array $query_vars Default WP_Query arguments.
*/
Expand Down Expand Up @@ -1378,7 +1378,7 @@ function bool_from_yn( $yn ) {
*
* @since 2.1.0
*
* @global WP_Query $wp_query Used to tell if the use a comment feed.
* @global WP_Query $wp_query WordPress Query object.
*/
function do_feed() {
global $wp_query;
Expand Down Expand Up @@ -2966,7 +2966,7 @@ function wp_nonce_ays( $action ) {
* an integer to be used as the response code.
* @since 5.1.0 The `$link_url`, `$link_text`, and `$exit` arguments were added.
*
* @global WP_Query $wp_query Global WP_Query instance.
* @global WP_Query $wp_query WordPress Query object.
*
* @param string|WP_Error $message Optional. Error message. If this is a WP_Error object,
* and not an Ajax or XML-RPC request, the error's messages are used.
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/general-template.php
Expand Up @@ -3925,7 +3925,7 @@ function language_attributes( $doctype = 'html' ) {
* @since 2.1.0
* @since 4.9.0 Added the `aria_current` argument.
*
* @global WP_Query $wp_query
* @global WP_Query $wp_query WordPress Query object.
* @global WP_Rewrite $wp_rewrite WordPress rewrite component.
*
* @param string|array $args {
Expand Down
6 changes: 3 additions & 3 deletions src/wp-includes/link-template.php
Expand Up @@ -2322,7 +2322,7 @@ function next_posts( $max_page = 0, $echo = true ) {
* @since 2.7.0
*
* @global int $paged
* @global WP_Query $wp_query
* @global WP_Query $wp_query WordPress Query object.
*
* @param string $label Content for link text.
* @param int $max_page Optional. Max pages. Default 0.
Expand Down Expand Up @@ -2460,7 +2460,7 @@ function previous_posts_link( $label = null ) {
*
* @since 2.8.0
*
* @global WP_Query $wp_query
* @global WP_Query $wp_query WordPress Query object.
*
* @param string|array $args {
* Optional. Arguments to build the post pages link navigation.
Expand Down Expand Up @@ -2801,7 +2801,7 @@ function get_comments_pagenum_link( $pagenum = 1, $max_page = 0 ) {
*
* @since 2.7.1
*
* @global WP_Query $wp_query
* @global WP_Query $wp_query WordPress Query object.
*
* @param string $label Optional. Label for link text. Default empty.
* @param int $max_page Optional. Max page. Default 0.
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/nav-menu-template.php
Expand Up @@ -294,7 +294,7 @@ function wp_nav_menu( $args = array() ) {
* @access private
* @since 3.0.0
*
* @global WP_Query $wp_query
* @global WP_Query $wp_query WordPress Query object.
* @global WP_Rewrite $wp_rewrite WordPress rewrite component.
*
* @param array $menu_items The current menu item objects to which to add the class property information.
Expand Down
4 changes: 2 additions & 2 deletions src/wp-includes/post-template.php
Expand Up @@ -607,7 +607,7 @@ function body_class( $class = '' ) {
*
* @since 2.8.0
*
* @global WP_Query $wp_query
* @global WP_Query $wp_query WordPress Query object.
*
* @param string|string[] $class Space-separated string or array of class names to add to the class list.
* @return string[] Array of class names.
Expand Down Expand Up @@ -1233,7 +1233,7 @@ function wp_dropdown_pages( $args = '' ) {
*
* @see get_pages()
*
* @global WP_Query $wp_query
* @global WP_Query $wp_query WordPress Query object.
*
* @param array|string $args {
* Optional. Array or string of arguments to generate a list of pages. See `get_pages()` for additional arguments.
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/post-thumbnail-template.php
Expand Up @@ -83,7 +83,7 @@ function the_post_thumbnail( $size = 'post-thumbnail', $attr = '' ) {
*
* @since 3.2.0
*
* @global WP_Query $wp_query
* @global WP_Query $wp_query WordPress Query object.
*
* @param WP_Query $wp_query Optional. A WP_Query instance. Defaults to the $wp_query global.
*/
Expand Down

0 comments on commit d19f4d7

Please sign in to comment.