Changeset 55887
- Timestamp:
- 06/07/2023 06:51:53 AM (16 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-query.php
r55855 r55887 541 541 542 542 /** 543 * Reparse the query vars.543 * Reparses the query vars. 544 544 * 545 545 * @since 1.5.0 … … 633 633 634 634 /** 635 * Parse a query string and setquery type booleans.635 * Parses a query string and sets query type booleans. 636 636 * 637 637 * @since 1.5.0 … … 653 653 * Optional. Array or string of Query parameters. 654 654 * 655 * @type int $attachment_id 656 * @type int|string $author 657 * @type string $author_name 658 * @type int[] $author__in 659 * @type int[] $author__not_in 660 * @type bool $cache_results 661 * @type int|string $cat 662 * @type int[] $category__and 663 * @type int[] $category__in 664 * @type int[] $category__not_in 665 * @type string $category_name 666 * @type array|int $comment_count 667 * 668 * 669 * 670 * @type string $comment_status 671 * @type int $comments_per_page 672 * 673 * @type array $date_query 674 * 675 * @type int $day 676 * @type bool $exact 677 * @type string $fields 678 * 679 * 680 * 681 * 682 * 683 * @type int $hour 684 * @type int|bool $ignore_sticky_posts 685 * 686 * 687 * @type int $m 688 * 689 * @type string|string[] $meta_key 690 * @type string|string[] $meta_value 691 * @type string $meta_compare 692 * 693 * @type string $meta_compare_key 694 * 695 * @type string $meta_type 696 * 697 * @type string $meta_type_key 698 * 699 * @type array $meta_query 700 * 701 * @type int $menu_order 702 * @type int $minute 703 * @type int $monthnum 704 * @type string $name 705 * @type bool $nopaging 706 * @type bool $no_found_rows 707 * 708 * @type int $offset 709 * @type string $order 710 * 711 * @type string|array $orderby 712 * 713 * 714 * 715 * 716 * 717 * 718 * 719 * 720 * 721 * 722 * 723 * 724 * 725 * 726 * 727 * 728 * 729 * 730 * 731 * 732 * 733 * 734 * 735 * 736 * @type int $p 737 * @type int $page 738 * 739 * @type int $paged 740 * @type int $page_id 741 * @type string $pagename 742 * @type string $perm 743 * @type string $ping_status 744 * @type int[] $post__in 745 * @type int[] $post__not_in 746 * 747 * @type string $post_mime_type 748 * @type string[] $post_name__in 749 * @type int $post_parent 750 * 751 * @type int[] $post_parent__in 752 * @type int[] $post_parent__not_in 753 * @type string|string[] $post_type 754 * 755 * @type string|string[] $post_status 756 * @type int $posts_per_page 757 * @type int $posts_per_archive_page 758 * 759 * @type string $s 760 * 761 * 762 * 763 * 764 * @type string[] $search_columns 765 * 766 * @type int $second 767 * @type bool $sentence 768 * @type bool $suppress_filters 769 * @type string $tag 770 * @type int[] $tag__and 771 * @type int[] $tag__in 772 * @type int[] $tag__not_in 773 * @type int $tag_id 774 * @type string[] $tag_slug__and 775 * @type string[] $tag_slug__in 776 * 777 * @type array $tax_query 778 * 779 * @type string $title 780 * @type bool $update_post_meta_cache 781 * @type bool $update_post_term_cache 782 * @type bool $update_menu_item_cache 783 * @type bool $lazy_load_term_meta 784 * 785 * 786 * 787 * @type int $w 788 * @type int $year 655 * @type int $attachment_id Attachment post ID. Used for 'attachment' post_type. 656 * @type int|string $author Author ID, or comma-separated list of IDs. 657 * @type string $author_name User 'user_nicename'. 658 * @type int[] $author__in An array of author IDs to query from. 659 * @type int[] $author__not_in An array of author IDs not to query from. 660 * @type bool $cache_results Whether to cache post information. Default true. 661 * @type int|string $cat Category ID or comma-separated list of IDs (this or any children). 662 * @type int[] $category__and An array of category IDs (AND in). 663 * @type int[] $category__in An array of category IDs (OR in, no children). 664 * @type int[] $category__not_in An array of category IDs (NOT in). 665 * @type string $category_name Use category slug (not name, this or any children). 666 * @type array|int $comment_count Filter results by comment count. Provide an integer to match 667 * comment count exactly. Provide an array with integer 'value' 668 * and 'compare' operator ('=', '!=', '>', '>=', '<', '<=' ) to 669 * compare against comment_count in a specific way. 670 * @type string $comment_status Comment status. 671 * @type int $comments_per_page The number of comments to return per page. 672 * Default 'comments_per_page' option. 673 * @type array $date_query An associative array of WP_Date_Query arguments. 674 * See WP_Date_Query::__construct(). 675 * @type int $day Day of the month. Default empty. Accepts numbers 1-31. 676 * @type bool $exact Whether to search by exact keyword. Default false. 677 * @type string $fields Post fields to query for. Accepts: 678 * - '' Returns an array of complete post objects (`WP_Post[]`). 679 * - 'ids' Returns an array of post IDs (`int[]`). 680 * - 'id=>parent' Returns an associative array of parent post IDs, 681 * keyed by post ID (`int[]`). 682 * Default ''. 683 * @type int $hour Hour of the day. Default empty. Accepts numbers 0-23. 684 * @type int|bool $ignore_sticky_posts Whether to ignore sticky posts or not. Setting this to false 685 * excludes stickies from 'post__in'. Accepts 1|true, 0|false. 686 * Default false. 687 * @type int $m Combination YearMonth. Accepts any four-digit year and month 688 * numbers 01-12. Default empty. 689 * @type string|string[] $meta_key Meta key or keys to filter by. 690 * @type string|string[] $meta_value Meta value or values to filter by. 691 * @type string $meta_compare MySQL operator used for comparing the meta value. 692 * See WP_Meta_Query::__construct() for accepted values and default value. 693 * @type string $meta_compare_key MySQL operator used for comparing the meta key. 694 * See WP_Meta_Query::__construct() for accepted values and default value. 695 * @type string $meta_type MySQL data type that the meta_value column will be CAST to for comparisons. 696 * See WP_Meta_Query::__construct() for accepted values and default value. 697 * @type string $meta_type_key MySQL data type that the meta_key column will be CAST to for comparisons. 698 * See WP_Meta_Query::__construct() for accepted values and default value. 699 * @type array $meta_query An associative array of WP_Meta_Query arguments. 700 * See WP_Meta_Query::__construct() for accepted values. 701 * @type int $menu_order The menu order of the posts. 702 * @type int $minute Minute of the hour. Default empty. Accepts numbers 0-59. 703 * @type int $monthnum The two-digit month. Default empty. Accepts numbers 1-12. 704 * @type string $name Post slug. 705 * @type bool $nopaging Show all posts (true) or paginate (false). Default false. 706 * @type bool $no_found_rows Whether to skip counting the total rows found. Enabling can improve 707 * performance. Default false. 708 * @type int $offset The number of posts to offset before retrieval. 709 * @type string $order Designates ascending or descending order of posts. Default 'DESC'. 710 * Accepts 'ASC', 'DESC'. 711 * @type string|array $orderby Sort retrieved posts by parameter. One or more options may be passed. 712 * To use 'meta_value', or 'meta_value_num', 'meta_key=keyname' must be 713 * also be defined. To sort by a specific `$meta_query` clause, use that 714 * clause's array key. Accepts: 715 * - 'none' 716 * - 'name' 717 * - 'author' 718 * - 'date' 719 * - 'title' 720 * - 'modified' 721 * - 'menu_order' 722 * - 'parent' 723 * - 'ID' 724 * - 'rand' 725 * - 'relevance' 726 * - 'RAND(x)' (where 'x' is an integer seed value) 727 * - 'comment_count' 728 * - 'meta_value' 729 * - 'meta_value_num' 730 * - 'post__in' 731 * - 'post_name__in' 732 * - 'post_parent__in' 733 * - The array keys of `$meta_query`. 734 * Default is 'date', except when a search is being performed, when 735 * the default is 'relevance'. 736 * @type int $p Post ID. 737 * @type int $page Show the number of posts that would show up on page X of a 738 * static front page. 739 * @type int $paged The number of the current page. 740 * @type int $page_id Page ID. 741 * @type string $pagename Page slug. 742 * @type string $perm Show posts if user has the appropriate capability. 743 * @type string $ping_status Ping status. 744 * @type int[] $post__in An array of post IDs to retrieve, sticky posts will be included. 745 * @type int[] $post__not_in An array of post IDs not to retrieve. Note: a string of comma- 746 * separated IDs will NOT work. 747 * @type string $post_mime_type The mime type of the post. Used for 'attachment' post_type. 748 * @type string[] $post_name__in An array of post slugs that results must match. 749 * @type int $post_parent Page ID to retrieve child pages for. Use 0 to only retrieve 750 * top-level pages. 751 * @type int[] $post_parent__in An array containing parent page IDs to query child pages from. 752 * @type int[] $post_parent__not_in An array containing parent page IDs not to query child pages from. 753 * @type string|string[] $post_type A post type slug (string) or array of post type slugs. 754 * Default 'any' if using 'tax_query'. 755 * @type string|string[] $post_status A post status (string) or array of post statuses. 756 * @type int $posts_per_page The number of posts to query for. Use -1 to request all posts. 757 * @type int $posts_per_archive_page The number of posts to query for by archive page. Overrides 758 * 'posts_per_page' when is_archive(), or is_search() are true. 759 * @type string $s Search keyword(s). Prepending a term with a hyphen will 760 * exclude posts matching that term. Eg, 'pillow -sofa' will 761 * return posts containing 'pillow' but not 'sofa'. The 762 * character used for exclusion can be modified using the 763 * the 'wp_query_search_exclusion_prefix' filter. 764 * @type string[] $search_columns Array of column names to be searched. Accepts 'post_title', 765 * 'post_excerpt' and 'post_content'. Default empty array. 766 * @type int $second Second of the minute. Default empty. Accepts numbers 0-59. 767 * @type bool $sentence Whether to search by phrase. Default false. 768 * @type bool $suppress_filters Whether to suppress filters. Default false. 769 * @type string $tag Tag slug. Comma-separated (either), Plus-separated (all). 770 * @type int[] $tag__and An array of tag IDs (AND in). 771 * @type int[] $tag__in An array of tag IDs (OR in). 772 * @type int[] $tag__not_in An array of tag IDs (NOT in). 773 * @type int $tag_id Tag id or comma-separated list of IDs. 774 * @type string[] $tag_slug__and An array of tag slugs (AND in). 775 * @type string[] $tag_slug__in An array of tag slugs (OR in). unless 'ignore_sticky_posts' is 776 * true. Note: a string of comma-separated IDs will NOT work. 777 * @type array $tax_query An associative array of WP_Tax_Query arguments. 778 * See WP_Tax_Query::__construct(). 779 * @type string $title Post title. 780 * @type bool $update_post_meta_cache Whether to update the post meta cache. Default true. 781 * @type bool $update_post_term_cache Whether to update the post term cache. Default true. 782 * @type bool $update_menu_item_cache Whether to update the menu item cache. Default false. 783 * @type bool $lazy_load_term_meta Whether to lazy-load term meta. Setting to false will 784 * disable cache priming for term meta, so that each 785 * get_term_meta() call will hit the database. 786 * Defaults to the value of `$update_post_term_cache`. 787 * @type int $w The week number of the year. Default empty. Accepts numbers 0-53. 788 * @type int $year The four-digit year. Default empty. Accepts any four-digit year. 789 789 * } 790 790 */ … … 1504 1504 1505 1505 /** 1506 * Check if the terms are suitable for searching.1506 * Checks if the terms are suitable for searching. 1507 1507 * 1508 1508 * Uses an array of stopwords (terms) that are excluded from the separate … … 1545 1545 1546 1546 /** 1547 * Retrieve stopwords used when parsing search terms.1547 * Retrieves stopwords used when parsing search terms. 1548 1548 * 1549 1549 * @since 3.7.0 … … 3541 3541 3542 3542 /** 3543 * Set up the amount of found posts and the number of pages (if limit clause was used)3543 * Sets up the amount of found posts and the number of pages (if limit clause was used) 3544 3544 * for the current query. 3545 3545 * … … 3600 3600 3601 3601 /** 3602 * Set up the next post and iterate current post index.3602 * Sets up the next post and iterate current post index. 3603 3603 * 3604 3604 * @since 1.5.0 … … 3699 3699 3700 3700 /** 3701 * Rewind the posts and resetpost index.3701 * Rewinds the posts and resets post index. 3702 3702 * 3703 3703 * @since 1.5.0 … … 3711 3711 3712 3712 /** 3713 * Iterate current comment index and returnWP_Comment object.3713 * Iterates current comment index and returns WP_Comment object. 3714 3714 * 3715 3715 * @since 2.2.0 … … 3748 3748 3749 3749 /** 3750 * Whether there are more comments available.3750 * Determines whether there are more comments available. 3751 3751 * 3752 3752 * Automatically rewinds comments when finished. … … 3767 3767 3768 3768 /** 3769 * Rewind the comments, resets the comment index and comment to first.3769 * Rewinds the comments, resets the comment index and comment to first. 3770 3770 * 3771 3771 * @since 2.2.0 … … 3929 3929 3930 3930 /** 3931 * Make private properties readable for backward compatibility.3931 * Makes private properties readable for backward compatibility. 3932 3932 * 3933 3933 * @since 4.0.0 … … 3943 3943 3944 3944 /** 3945 * Make private properties checkable for backward compatibility.3945 * Makes private properties checkable for backward compatibility. 3946 3946 * 3947 3947 * @since 4.0.0 … … 3957 3957 3958 3958 /** 3959 * Make private/protected methods readable for backward compatibility.3959 * Makes private/protected methods readable for backward compatibility. 3960 3960 * 3961 3961 * @since 4.0.0 … … 3973 3973 3974 3974 /** 3975 * Is the query for an existing archive page?3975 * Determines whether the query is for an existing archive page. 3976 3976 * 3977 3977 * Archive pages include category, tag, author, date, custom post type, … … 3994 3994 3995 3995 /** 3996 * Is the query for an existing post type archive page?3996 * Determines whether the query is for an existing post type archive page. 3997 3997 * 3998 3998 * @since 3.1.0 … … 4021 4021 4022 4022 /** 4023 * Is the query for an existing attachment page?4023 * Determines whether the query is for an existing attachment page. 4024 4024 * 4025 4025 * @since 3.1.0 … … 4056 4056 4057 4057 /** 4058 * Is the query for an existing author archive page?4058 * Determines whether the query is for an existing author archive page. 4059 4059 * 4060 4060 * If the $author parameter is specified, this function will additionally … … 4095 4095 4096 4096 /** 4097 * Is the query for an existing category archive page?4097 * Determines whether the query is for an existing category archive page. 4098 4098 * 4099 4099 * If the $category parameter is specified, this function will additionally … … 4134 4134 4135 4135 /** 4136 * Is the query for an existing tag archive page?4136 * Determines whether the query is for an existing tag archive page. 4137 4137 * 4138 4138 * If the $tag parameter is specified, this function will additionally … … 4173 4173 4174 4174 /** 4175 * Is the query for an existing custom taxonomy archive page?4175 * Determines whether the query is for an existing custom taxonomy archive page. 4176 4176 * 4177 4177 * If the $taxonomy parameter is specified, this function will additionally … … 4229 4229 4230 4230 /** 4231 * Whether the current URL is within the comments popup window.4231 * Determines whether the current URL is within the comments popup window. 4232 4232 * 4233 4233 * @since 3.1.0 … … 4243 4243 4244 4244 /** 4245 * Is the query for an existing date archive?4245 * Determines whether the query is for an existing date archive. 4246 4246 * 4247 4247 * @since 3.1.0 … … 4254 4254 4255 4255 /** 4256 * Is the query for an existing day archive?4256 * Determines whether the query is for an existing day archive. 4257 4257 * 4258 4258 * @since 3.1.0 … … 4265 4265 4266 4266 /** 4267 * Is the query for a feed?4267 * Determines whether the query is for a feed. 4268 4268 * 4269 4269 * @since 3.1.0 … … 4287 4287 4288 4288 /** 4289 * Is the query for a comments feed?4289 * Determines whether the query is for a comments feed. 4290 4290 * 4291 4291 * @since 3.1.0 … … 4298 4298 4299 4299 /** 4300 * Is the query for the front page of the site?4300 * Determines whether the query is for the front page of the site. 4301 4301 * 4302 4302 * This is for what is displayed at your site's main URL. … … 4327 4327 4328 4328 /** 4329 * Is the query for the blog homepage?4329 * Determines whether the query is for the blog homepage. 4330 4330 * 4331 4331 * This is the page which shows the time based blog content of your site. … … 4347 4347 4348 4348 /** 4349 * Is the query for the Privacy Policy page?4349 * Determines whether the query is for the Privacy Policy page. 4350 4350 * 4351 4351 * This is the page which shows the Privacy Policy content of your site. … … 4370 4370 4371 4371 /** 4372 * Is the query for an existing month archive?4372 * Determines whether the query is for an existing month archive. 4373 4373 * 4374 4374 * @since 3.1.0 … … 4381 4381 4382 4382 /** 4383 * Is the query for an existing single page?4383 * Determines whether the query is for an existing single page. 4384 4384 * 4385 4385 * If the $page parameter is specified, this function will additionally … … 4434 4434 4435 4435 /** 4436 * Is the query for a paged result and not for the first page?4436 * Determines whether the query is for a paged result and not for the first page. 4437 4437 * 4438 4438 * @since 3.1.0 … … 4445 4445 4446 4446 /** 4447 * Is the query for a post or page preview?4447 * Determines whether the query is for a post or page preview. 4448 4448 * 4449 4449 * @since 3.1.0 … … 4456 4456 4457 4457 /** 4458 * Is the query for the robots.txt file?4458 * Determines whether the query is for the robots.txt file. 4459 4459 * 4460 4460 * @since 3.1.0 … … 4467 4467 4468 4468 /** 4469 * Is the query for the favicon.ico file?4469 * Determines whether the query is for the favicon.ico file. 4470 4470 * 4471 4471 * @since 5.4.0 … … 4478 4478 4479 4479 /** 4480 * Is the query for a search?4480 * Determines whether the query is for a search. 4481 4481 * 4482 4482 * @since 3.1.0 … … 4489 4489 4490 4490 /** 4491 * Is the query for an existing single post?4491 * Determines whether the query is for an existing single post. 4492 4492 * 4493 4493 * Works for any post type excluding pages. … … 4543 4543 4544 4544 /** 4545 * Is the query for an existing single post of any post type (post, attachment, page,4546 * custom post types)?4545 * Determines whether the query is for an existing single post of any post type 4546 * (post, attachment, page, custom post types). 4547 4547 * 4548 4548 * If the $post_types parameter is specified, this function will additionally … … 4573 4573 4574 4574 /** 4575 * Is the query for a specific time?4575 * Determines whether the query is for a specific time. 4576 4576 * 4577 4577 * @since 3.1.0 … … 4584 4584 4585 4585 /** 4586 * Is the query for a trackback endpoint call?4586 * Determines whether the query is for a trackback endpoint call. 4587 4587 * 4588 4588 * @since 3.1.0 … … 4595 4595 4596 4596 /** 4597 * Is the query for an existing year archive?4597 * Determines whether the query is for an existing year archive. 4598 4598 * 4599 4599 * @since 3.1.0 … … 4606 4606 4607 4607 /** 4608 * Is the query a 404 (returns no results)?4608 * Determines whether the query is a 404 (returns no results). 4609 4609 * 4610 4610 * @since 3.1.0 … … 4617 4617 4618 4618 /** 4619 * Is the query for an embedded post?4619 * Determines whether the query is for an embedded post. 4620 4620 * 4621 4621 * @since 4.4.0 … … 4628 4628 4629 4629 /** 4630 * Is the query the main query?4630 * Determines whether the query is the main query. 4631 4631 * 4632 4632 * @since 3.3.0 … … 4642 4642 4643 4643 /** 4644 * Set up global post data.4644 * Sets up global post data. 4645 4645 * 4646 4646 * @since 4.1.0 … … 4701 4701 4702 4702 /** 4703 * Generate post data.4703 * Generates post data. 4704 4704 * 4705 4705 * @since 5.2.0 … … 4804 4804 4805 4805 /** 4806 * Generate cache key.4806 * Generates cache key. 4807 4807 * 4808 4808 * @since 6.1.0 … … 4812 4812 * @param array $args Query arguments. 4813 4813 * @param string $sql SQL statement. 4814 *4815 4814 * @return string Cache key. 4816 4815 */ … … 4874 4873 4875 4874 /** 4876 * Lazyload term meta for posts in the loop.4875 * Lazyloads term meta for posts in the loop. 4877 4876 * 4878 4877 * @since 4.4.0 … … 4889 4888 4890 4889 /** 4891 * Lazyload comment meta for comments in the loop.4890 * Lazyloads comment meta for comments in the loop. 4892 4891 * 4893 4892 * @since 4.4.0
Note: See TracChangeset
for help on using the changeset viewer.