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

Props mukesh27.
See #45604, #47110.
Built from https://develop.svn.wordpress.org/trunk@45739


git-svn-id: http://core.svn.wordpress.org/trunk@45550 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2019-08-04 01:59:56 +00:00
parent 77a31e6875
commit 7f7480cb2a
21 changed files with 85 additions and 85 deletions

View File

@ -61,7 +61,7 @@ class WP_Media_List_Table extends WP_List_Table {
}
/**
* @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

View File

@ -136,7 +136,7 @@ class WP_Posts_List_Table extends WP_List_Table {
/**
* @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
*/
@ -695,7 +695,7 @@ class WP_Posts_List_Table extends WP_List_Table {
}
/**
* @global WP_Query $wp_query
* @global WP_Query $wp_query WordPress Query object.
* @global int $per_page
* @param array $posts
* @param int $level

View File

@ -525,7 +525,7 @@ function export_wp( $args = array() ) {
<?php
if ( $post_ids ) {
/**
* @global WP_Query $wp_query
* @global WP_Query $wp_query WordPress Query object.
*/
global $wp_query;

View File

@ -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.
@ -2527,7 +2527,7 @@ jQuery(function($){
* @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

View File

@ -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.
*

View File

@ -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.

View File

@ -4161,7 +4161,7 @@ class WP_Query {
*
* @since 3.3.0
*
* @global WP_Query $wp_query Global WP_Query instance.
* @global WP_Query $wp_query WordPress Query object.
*
* @return bool
*/

View File

@ -560,14 +560,14 @@ class WP {
*
* @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;
@ -606,7 +606,7 @@ class WP {
*
* @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;
@ -629,7 +629,7 @@ class WP {
*
* @since 2.0.0
*
* @global WP_Query $wp_query
* @global WP_Query $wp_query WordPress Query object.
*/
public function handle_404() {
global $wp_query;

View File

@ -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
@ -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

View File

@ -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.

View File

@ -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
*

View File

@ -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.
*/
@ -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;
@ -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.

View File

@ -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 {

View File

@ -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.
@ -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.
@ -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.

View File

@ -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.

View File

@ -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.
@ -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.

View File

@ -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.
*/

View File

@ -17,7 +17,7 @@
* @since 1.5.0
* @since 3.9.0 The `$default` argument was introduced.
*
* @global WP_Query $wp_query Global WP_Query instance.
* @global WP_Query $wp_query WordPress Query object.
*
* @param string $var The variable key to retrieve.
* @param mixed $default Optional. Value to return if the query variable is not set. Default empty.
@ -35,7 +35,7 @@ function get_query_var( $var, $default = '' ) {
*
* @since 3.1.0
*
* @global WP_Query $wp_query Global WP_Query instance.
* @global WP_Query $wp_query WordPress Query object.
*
* @return object Queried object.
*/
@ -51,7 +51,7 @@ function get_queried_object() {
*
* @since 3.1.0
*
* @global WP_Query $wp_query Global WP_Query instance.
* @global WP_Query $wp_query WordPress Query object.
*
* @return int ID of the queried object.
*/
@ -65,7 +65,7 @@ function get_queried_object_id() {
*
* @since 2.2.0
*
* @global WP_Query $wp_query Global WP_Query instance.
* @global WP_Query $wp_query WordPress Query object.
*
* @param string $var Query variable key.
* @param mixed $value Query variable value.
@ -88,7 +88,7 @@ function set_query_var( $var, $value ) {
*
* @since 1.5.0
*
* @global WP_Query $wp_query Global WP_Query instance.
* @global WP_Query $wp_query WordPress Query object.
*
* @param array|string $query Array or string of WP_Query arguments.
* @return array List of post objects.
@ -107,7 +107,7 @@ function query_posts( $query ) {
*
* @since 2.3.0
*
* @global WP_Query $wp_query Global WP_Query instance.
* @global WP_Query $wp_query WordPress Query object.
* @global WP_Query $wp_the_query Copy of the global WP_Query instance created during wp_reset_query().
*/
function wp_reset_query() {
@ -121,7 +121,7 @@ function wp_reset_query() {
*
* @since 3.0.0
*
* @global WP_Query $wp_query Global WP_Query instance.
* @global WP_Query $wp_query WordPress Query object.
*/
function wp_reset_postdata() {
global $wp_query;
@ -146,7 +146,7 @@ function wp_reset_postdata() {
*
* @since 1.5.0
*
* @global WP_Query $wp_query Global WP_Query instance.
* @global WP_Query $wp_query WordPress Query object.
*
* @return bool
*/
@ -170,7 +170,7 @@ function is_archive() {
*
* @since 3.1.0
*
* @global WP_Query $wp_query Global WP_Query instance.
* @global WP_Query $wp_query WordPress Query object.
*
* @param string|array $post_types Optional. Post type or array of posts types to check against.
* @return bool
@ -195,7 +195,7 @@ function is_post_type_archive( $post_types = '' ) {
*
* @since 2.0.0
*
* @global WP_Query $wp_query Global WP_Query instance.
* @global WP_Query $wp_query WordPress Query object.
*
* @param int|string|array|object $attachment Attachment ID, title, slug, or array of such.
* @return bool
@ -223,7 +223,7 @@ function is_attachment( $attachment = '' ) {
*
* @since 1.5.0
*
* @global WP_Query $wp_query Global WP_Query instance.
* @global WP_Query $wp_query WordPress Query object.
*
* @param mixed $author Optional. User ID, nickname, nicename, or array of User IDs, nicknames, and nicenames
* @return bool
@ -251,7 +251,7 @@ function is_author( $author = '' ) {
*
* @since 1.5.0
*
* @global WP_Query $wp_query Global WP_Query instance.
* @global WP_Query $wp_query WordPress Query object.
*
* @param mixed $category Optional. Category ID, name, slug, or array of Category IDs, names, and slugs.
* @return bool
@ -279,7 +279,7 @@ function is_category( $category = '' ) {
*
* @since 2.3.0
*
* @global WP_Query $wp_query Global WP_Query instance.
* @global WP_Query $wp_query WordPress Query object.
*
* @param mixed $tag Optional. Tag ID, name, slug, or array of Tag IDs, names, and slugs.
* @return bool
@ -311,7 +311,7 @@ function is_tag( $tag = '' ) {
*
* @since 2.5.0
*
* @global WP_Query $wp_query Global WP_Query instance.
* @global WP_Query $wp_query WordPress Query object.
*
* @param string|array $taxonomy Optional. Taxonomy slug or slugs.
* @param int|string|array $term Optional. Term ID, name, slug or array of Term IDs, names, and slugs.
@ -337,7 +337,7 @@ function is_tax( $taxonomy = '', $term = '' ) {
*
* @since 1.5.0
*
* @global WP_Query $wp_query Global WP_Query instance.
* @global WP_Query $wp_query WordPress Query object.
*
* @return bool
*/
@ -363,7 +363,7 @@ function is_date() {
*
* @since 1.5.0
*
* @global WP_Query $wp_query Global WP_Query instance.
* @global WP_Query $wp_query WordPress Query object.
*
* @return bool
*/
@ -387,7 +387,7 @@ function is_day() {
*
* @since 1.5.0
*
* @global WP_Query $wp_query Global WP_Query instance.
* @global WP_Query $wp_query WordPress Query object.
*
* @param string|array $feeds Optional feed types to check.
* @return bool
@ -408,7 +408,7 @@ function is_feed( $feeds = '' ) {
*
* @since 3.0.0
*
* @global WP_Query $wp_query Global WP_Query instance.
* @global WP_Query $wp_query WordPress Query object.
*
* @return bool
*/
@ -441,7 +441,7 @@ function is_comment_feed() {
*
* @since 2.5.0
*
* @global WP_Query $wp_query Global WP_Query instance.
* @global WP_Query $wp_query WordPress Query object.
*
* @return bool True, if front of site.
*/
@ -474,7 +474,7 @@ function is_front_page() {
* @since 1.5.0
*
* @see is_front_page()
* @global WP_Query $wp_query Global WP_Query instance.
* @global WP_Query $wp_query WordPress Query object.
*
* @return bool True if blog view homepage, otherwise false.
*/
@ -504,7 +504,7 @@ function is_home() {
*
* @since 5.2.0
*
* @global WP_Query $wp_query Global WP_Query instance.
* @global WP_Query $wp_query WordPress Query object.
*
* @return bool
*/
@ -528,7 +528,7 @@ function is_privacy_policy() {
*
* @since 1.5.0
*
* @global WP_Query $wp_query Global WP_Query instance.
* @global WP_Query $wp_query WordPress Query object.
*
* @return bool
*/
@ -558,7 +558,7 @@ function is_month() {
*
* @since 1.5.0
*
* @global WP_Query $wp_query Global WP_Query instance.
* @global WP_Query $wp_query WordPress Query object.
*
* @param int|string|array $page Optional. Page ID, title, slug, or array of such. Default empty.
* @return bool Whether the query is for an existing single page.
@ -583,7 +583,7 @@ function is_page( $page = '' ) {
*
* @since 1.5.0
*
* @global WP_Query $wp_query Global WP_Query instance.
* @global WP_Query $wp_query WordPress Query object.
*
* @return bool
*/
@ -607,7 +607,7 @@ function is_paged() {
*
* @since 2.0.0
*
* @global WP_Query $wp_query Global WP_Query instance.
* @global WP_Query $wp_query WordPress Query object.
*
* @return bool
*/
@ -627,7 +627,7 @@ function is_preview() {
*
* @since 2.1.0
*
* @global WP_Query $wp_query Global WP_Query instance.
* @global WP_Query $wp_query WordPress Query object.
*
* @return bool
*/
@ -651,7 +651,7 @@ function is_robots() {
*
* @since 1.5.0
*
* @global WP_Query $wp_query Global WP_Query instance.
* @global WP_Query $wp_query WordPress Query object.
*
* @return bool
*/
@ -683,7 +683,7 @@ function is_search() {
*
* @since 1.5.0
*
* @global WP_Query $wp_query Global WP_Query instance.
* @global WP_Query $wp_query WordPress Query object.
*
* @param int|string|array $post Optional. Post ID, title, slug, or array of such. Default empty.
* @return bool Whether the query is for an existing single post.
@ -715,7 +715,7 @@ function is_single( $post = '' ) {
*
* @since 1.5.0
*
* @global WP_Query $wp_query Global WP_Query instance.
* @global WP_Query $wp_query WordPress Query object.
*
* @param string|array $post_types Optional. Post type or array of post types. Default empty.
* @return bool Whether the query is for an existing single post of any of the given post types.
@ -740,7 +740,7 @@ function is_singular( $post_types = '' ) {
*
* @since 1.5.0
*
* @global WP_Query $wp_query Global WP_Query instance.
* @global WP_Query $wp_query WordPress Query object.
*
* @return bool
*/
@ -764,7 +764,7 @@ function is_time() {
*
* @since 1.5.0
*
* @global WP_Query $wp_query Global WP_Query instance.
* @global WP_Query $wp_query WordPress Query object.
*
* @return bool
*/
@ -788,7 +788,7 @@ function is_trackback() {
*
* @since 1.5.0
*
* @global WP_Query $wp_query Global WP_Query instance.
* @global WP_Query $wp_query WordPress Query object.
*
* @return bool
*/
@ -812,7 +812,7 @@ function is_year() {
*
* @since 1.5.0
*
* @global WP_Query $wp_query Global WP_Query instance.
* @global WP_Query $wp_query WordPress Query object.
*
* @return bool
*/
@ -832,7 +832,7 @@ function is_404() {
*
* @since 4.4.0
*
* @global WP_Query $wp_query Global WP_Query instance.
* @global WP_Query $wp_query WordPress Query object.
*
* @return bool Whether we're in an embedded post or not.
*/
@ -856,7 +856,7 @@ 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
*/
@ -886,7 +886,7 @@ function is_main_query() {
*
* @since 1.5.0
*
* @global WP_Query $wp_query Global WP_Query instance.
* @global WP_Query $wp_query WordPress Query object.
*
* @return bool
*/
@ -904,7 +904,7 @@ function have_posts() {
*
* @since 2.0.0
*
* @global WP_Query $wp_query Global WP_Query instance.
* @global WP_Query $wp_query WordPress Query object.
*
* @return bool True if caller is within loop, false if loop hasn't started or ended.
*/
@ -918,7 +918,7 @@ function in_the_loop() {
*
* @since 1.5.0
*
* @global WP_Query $wp_query Global WP_Query instance.
* @global WP_Query $wp_query WordPress Query object.
*/
function rewind_posts() {
global $wp_query;
@ -930,7 +930,7 @@ function rewind_posts() {
*
* @since 1.5.0
*
* @global WP_Query $wp_query Global WP_Query instance.
* @global WP_Query $wp_query WordPress Query object.
*/
function the_post() {
global $wp_query;
@ -946,7 +946,7 @@ function the_post() {
*
* @since 2.2.0
*
* @global WP_Query $wp_query Global WP_Query instance.
* @global WP_Query $wp_query WordPress Query object.
*
* @return bool
*/
@ -960,7 +960,7 @@ function have_comments() {
*
* @since 2.2.0
*
* @global WP_Query $wp_query Global WP_Query instance.
* @global WP_Query $wp_query WordPress Query object.
*
* @return object
*/
@ -1127,7 +1127,7 @@ function _find_post_by_old_date( $post_type ) {
* @since 1.5.0
* @since 4.4.0 Added the ability to pass a post ID to `$post`.
*
* @global WP_Query $wp_query Global WP_Query instance.
* @global WP_Query $wp_query WordPress Query object.
*
* @param WP_Post|object|int $post WP_Post instance or Post ID/object.
* @return bool True when finished.
@ -1147,7 +1147,7 @@ function setup_postdata( $post ) {
*
* @since 5.2.0
*
* @global WP_Query $wp_query Global WP_Query instance.
* @global WP_Query $wp_query WordPress Query object.
*
* @param WP_Post|object|int $post WP_Post instance or Post ID/object.
* @return array|bool Elements of post, or false on failure.

View File

@ -686,7 +686,7 @@ function locate_template( $template_names, $load = false, $require_once = true )
* @global array $posts
* @global WP_Post $post
* @global bool $wp_did_header
* @global WP_Query $wp_query
* @global WP_Query $wp_query WordPress Query object.
* @global WP_Rewrite $wp_rewrite WordPress rewrite component.
* @global wpdb $wpdb WordPress database abstraction object.
* @global string $wp_version

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.3-alpha-45738';
$wp_version = '5.3-alpha-45739';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

View File

@ -406,7 +406,7 @@ do_action( 'sanitize_comment_cookies' );
/**
* WordPress Query object
*
* @global WP_Query $wp_the_query
* @global WP_Query $wp_the_query WordPress Query object.
* @since 2.0.0
*/
$GLOBALS['wp_the_query'] = new WP_Query();
@ -415,7 +415,7 @@ $GLOBALS['wp_the_query'] = new WP_Query();
* Holds the reference to @see $wp_the_query
* Use this global for WordPress queries
*
* @global WP_Query $wp_query
* @global WP_Query $wp_query WordPress Query object.
* @since 1.5.0
*/
$GLOBALS['wp_query'] = $GLOBALS['wp_the_query'];