Changeset 52226 for trunk/src/wp-includes/class-wp-query.php
- Timestamp:
- 11/20/2021 12:06:06 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-query.php
r51885 r52226 631 631 * Optional. Array or string of Query parameters. 632 632 * 633 * @type int $attachment_id Attachment post ID. Used for 'attachment' post_type. 634 * @type int|string $author Author ID, or comma-separated list of IDs. 635 * @type string $author_name User 'user_nicename'. 636 * @type int[] $author__in An array of author IDs to query from. 637 * @type int[] $author__not_in An array of author IDs not to query from. 638 * @type bool $cache_results Whether to cache post information. Default true. 639 * @type int|string $cat Category ID or comma-separated list of IDs (this or any children). 640 * @type int[] $category__and An array of category IDs (AND in). 641 * @type int[] $category__in An array of category IDs (OR in, no children). 642 * @type int[] $category__not_in An array of category IDs (NOT in). 643 * @type string $category_name Use category slug (not name, this or any children). 644 * @type array|int $comment_count Filter results by comment count. Provide an integer to match 645 * comment count exactly. Provide an array with integer 'value' 646 * and 'compare' operator ('=', '!=', '>', '>=', '<', '<=' ) to 647 * compare against comment_count in a specific way. 648 * @type string $comment_status Comment status. 649 * @type int $comments_per_page The number of comments to return per page. 650 * Default 'comments_per_page' option. 651 * @type array $date_query An associative array of WP_Date_Query arguments. 652 * See WP_Date_Query::__construct(). 653 * @type int $day Day of the month. Default empty. Accepts numbers 1-31. 654 * @type bool $exact Whether to search by exact keyword. Default false. 655 * @type string $fields Post fields to query for. Accepts: 656 * - '' Returns an array of complete post objects (`WP_Post[]`). 657 * - 'ids' Returns an array of post IDs (`int[]`). 658 * - 'id=>parent' Returns an associative array of parent post IDs, 659 * keyed by post ID (`int[]`). 660 * Default ''. 661 * @type int $hour Hour of the day. Default empty. Accepts numbers 0-23. 662 * @type int|bool $ignore_sticky_posts Whether to ignore sticky posts or not. Setting this to false 663 * excludes stickies from 'post__in'. Accepts 1|true, 0|false. 664 * Default false. 665 * @type int $m Combination YearMonth. Accepts any four-digit year and month 666 * numbers 1-12. Default empty. 667 * @type string $meta_compare Comparison operator to test the 'meta_value'. 668 * @type string $meta_compare_key Comparison operator to test the 'meta_key'. 669 * @type string $meta_key Custom field key. 670 * @type array $meta_query An associative array of WP_Meta_Query arguments. See WP_Meta_Query. 671 * @type string $meta_value Custom field value. 672 * @type int $meta_value_num Custom field value number. 673 * @type string $meta_type_key Cast for 'meta_key'. See WP_Meta_Query::construct(). 674 * @type int $menu_order The menu order of the posts. 675 * @type int $minute Minute of the hour. Default empty. Accepts numbers 0-59. 676 * @type int $monthnum The two-digit month. Default empty. Accepts numbers 1-12. 677 * @type string $name Post slug. 678 * @type bool $nopaging Show all posts (true) or paginate (false). Default false. 679 * @type bool $no_found_rows Whether to skip counting the total rows found. Enabling can improve 680 * performance. Default false. 681 * @type int $offset The number of posts to offset before retrieval. 682 * @type string $order Designates ascending or descending order of posts. Default 'DESC'. 683 * Accepts 'ASC', 'DESC'. 684 * @type string|array $orderby Sort retrieved posts by parameter. One or more options may be 685 * passed. To use 'meta_value', or 'meta_value_num', 686 * 'meta_key=keyname' must be also be defined. To sort by a 687 * specific `$meta_query` clause, use that clause's array key. 688 * Accepts 'none', 'name', 'author', 'date', 'title', 689 * 'modified', 'menu_order', 'parent', 'ID', 'rand', 690 * 'relevance', 'RAND(x)' (where 'x' is an integer seed value), 691 * 'comment_count', 'meta_value', 'meta_value_num', 'post__in', 692 * 'post_name__in', 'post_parent__in', and the array keys 693 * of `$meta_query`. Default is 'date', except when a search 694 * is being performed, when the default is 'relevance'. 695 * @type int $p Post ID. 696 * @type int $page Show the number of posts that would show up on page X of a 697 * static front page. 698 * @type int $paged The number of the current page. 699 * @type int $page_id Page ID. 700 * @type string $pagename Page slug. 701 * @type string $perm Show posts if user has the appropriate capability. 702 * @type string $ping_status Ping status. 703 * @type int[] $post__in An array of post IDs to retrieve, sticky posts will be included. 704 * @type int[] $post__not_in An array of post IDs not to retrieve. Note: a string of comma- 705 * separated IDs will NOT work. 706 * @type string $post_mime_type The mime type of the post. Used for 'attachment' post_type. 707 * @type string[] $post_name__in An array of post slugs that results must match. 708 * @type int $post_parent Page ID to retrieve child pages for. Use 0 to only retrieve 709 * top-level pages. 710 * @type int[] $post_parent__in An array containing parent page IDs to query child pages from. 711 * @type int[] $post_parent__not_in An array containing parent page IDs not to query child pages from. 712 * @type string|array $post_type A post type slug (string) or array of post type slugs. 713 * Default 'any' if using 'tax_query'. 714 * @type string|array $post_status A post status (string) or array of post statuses. 715 * @type int $posts_per_page The number of posts to query for. Use -1 to request all posts. 716 * @type int $posts_per_archive_page The number of posts to query for by archive page. Overrides 717 * 'posts_per_page' when is_archive(), or is_search() are true. 718 * @type string $s Search keyword(s). Prepending a term with a hyphen will 719 * exclude posts matching that term. Eg, 'pillow -sofa' will 720 * return posts containing 'pillow' but not 'sofa'. The 721 * character used for exclusion can be modified using the 722 * the 'wp_query_search_exclusion_prefix' filter. 723 * @type int $second Second of the minute. Default empty. Accepts numbers 0-59. 724 * @type bool $sentence Whether to search by phrase. Default false. 725 * @type bool $suppress_filters Whether to suppress filters. Default false. 726 * @type string $tag Tag slug. Comma-separated (either), Plus-separated (all). 727 * @type int[] $tag__and An array of tag IDs (AND in). 728 * @type int[] $tag__in An array of tag IDs (OR in). 729 * @type int[] $tag__not_in An array of tag IDs (NOT in). 730 * @type int $tag_id Tag id or comma-separated list of IDs. 731 * @type string[] $tag_slug__and An array of tag slugs (AND in). 732 * @type string[] $tag_slug__in An array of tag slugs (OR in). unless 'ignore_sticky_posts' is 733 * true. Note: a string of comma-separated IDs will NOT work. 734 * @type array $tax_query An associative array of WP_Tax_Query arguments. 735 * See WP_Tax_Query->__construct(). 736 * @type string $title Post title. 737 * @type bool $update_post_meta_cache Whether to update the post meta cache. Default true. 738 * @type bool $update_post_term_cache Whether to update the post term cache. Default true. 739 * @type bool $lazy_load_term_meta Whether to lazy-load term meta. Setting to false will 740 * disable cache priming for term meta, so that each 741 * get_term_meta() call will hit the database. 742 * Defaults to the value of `$update_post_term_cache`. 743 * @type int $w The week number of the year. Default empty. Accepts numbers 0-53. 744 * @type int $year The four-digit year. Default empty. Accepts any four-digit year. 633 * @type int $attachment_id Attachment post ID. Used for 'attachment' post_type. 634 * @type int|string $author Author ID, or comma-separated list of IDs. 635 * @type string $author_name User 'user_nicename'. 636 * @type int[] $author__in An array of author IDs to query from. 637 * @type int[] $author__not_in An array of author IDs not to query from. 638 * @type bool $cache_results Whether to cache post information. Default true. 639 * @type int|string $cat Category ID or comma-separated list of IDs (this or any children). 640 * @type int[] $category__and An array of category IDs (AND in). 641 * @type int[] $category__in An array of category IDs (OR in, no children). 642 * @type int[] $category__not_in An array of category IDs (NOT in). 643 * @type string $category_name Use category slug (not name, this or any children). 644 * @type array|int $comment_count Filter results by comment count. Provide an integer to match 645 * comment count exactly. Provide an array with integer 'value' 646 * and 'compare' operator ('=', '!=', '>', '>=', '<', '<=' ) to 647 * compare against comment_count in a specific way. 648 * @type string $comment_status Comment status. 649 * @type int $comments_per_page The number of comments to return per page. 650 * Default 'comments_per_page' option. 651 * @type array $date_query An associative array of WP_Date_Query arguments. 652 * See WP_Date_Query::__construct(). 653 * @type int $day Day of the month. Default empty. Accepts numbers 1-31. 654 * @type bool $exact Whether to search by exact keyword. Default false. 655 * @type string $fields Post fields to query for. Accepts: 656 * - '' Returns an array of complete post objects (`WP_Post[]`). 657 * - 'ids' Returns an array of post IDs (`int[]`). 658 * - 'id=>parent' Returns an associative array of parent post IDs, 659 * keyed by post ID (`int[]`). 660 * Default ''. 661 * @type int $hour Hour of the day. Default empty. Accepts numbers 0-23. 662 * @type int|bool $ignore_sticky_posts Whether to ignore sticky posts or not. Setting this to false 663 * excludes stickies from 'post__in'. Accepts 1|true, 0|false. 664 * Default false. 665 * @type int $m Combination YearMonth. Accepts any four-digit year and month 666 * numbers 1-12. Default empty. 667 * @type string|string[] $meta_key Meta key or keys to filter by. 668 * @type string|string[] $meta_value Meta value or values to filter by. 669 * @type string $meta_compare MySQL operator used for comparing the meta value. 670 * See WP_Meta_Query::__construct for accepted values and default value. 671 * @type string $meta_compare_key MySQL operator used for comparing the meta key. 672 * See WP_Meta_Query::__construct for accepted values and default value. 673 * @type string $meta_type MySQL data type that the meta_value column will be CAST to for comparisons. 674 * See WP_Meta_Query::__construct for accepted values and default value. 675 * @type string $meta_type_key MySQL data type that the meta_key column will be CAST to for comparisons. 676 * See WP_Meta_Query::__construct for accepted values and default value. 677 * @type array $meta_query An associative array of WP_Meta_Query arguments. 678 * See WP_Meta_Query::__construct for accepted values. 679 * @type int $menu_order The menu order of the posts. 680 * @type int $minute Minute of the hour. Default empty. Accepts numbers 0-59. 681 * @type int $monthnum The two-digit month. Default empty. Accepts numbers 1-12. 682 * @type string $name Post slug. 683 * @type bool $nopaging Show all posts (true) or paginate (false). Default false. 684 * @type bool $no_found_rows Whether to skip counting the total rows found. Enabling can improve 685 * performance. Default false. 686 * @type int $offset The number of posts to offset before retrieval. 687 * @type string $order Designates ascending or descending order of posts. Default 'DESC'. 688 * Accepts 'ASC', 'DESC'. 689 * @type string|array $orderby Sort retrieved posts by parameter. One or more options may be passed. 690 * To use 'meta_value', or 'meta_value_num', 'meta_key=keyname' must be 691 * also be defined. To sort by a specific `$meta_query` clause, use that 692 * clause's array key. Accepts: 693 * - 'none' 694 * - 'name' 695 * - 'author' 696 * - 'date' 697 * - 'title' 698 * - 'modified' 699 * - 'menu_order' 700 * - 'parent' 701 * - 'ID' 702 * - 'rand' 703 * - 'relevance' 704 * - 'RAND(x)' (where 'x' is an integer seed value) 705 * - 'comment_count' 706 * - 'meta_value' 707 * - 'meta_value_num' 708 * - 'post__in' 709 * - 'post_name__in' 710 * - 'post_parent__in' 711 * - The array keys of `$meta_query`. 712 * Default is 'date', except when a search is being performed, when 713 * the default is 'relevance'. 714 * @type int $p Post ID. 715 * @type int $page Show the number of posts that would show up on page X of a 716 * static front page. 717 * @type int $paged The number of the current page. 718 * @type int $page_id Page ID. 719 * @type string $pagename Page slug. 720 * @type string $perm Show posts if user has the appropriate capability. 721 * @type string $ping_status Ping status. 722 * @type int[] $post__in An array of post IDs to retrieve, sticky posts will be included. 723 * @type int[] $post__not_in An array of post IDs not to retrieve. Note: a string of comma- 724 * separated IDs will NOT work. 725 * @type string $post_mime_type The mime type of the post. Used for 'attachment' post_type. 726 * @type string[] $post_name__in An array of post slugs that results must match. 727 * @type int $post_parent Page ID to retrieve child pages for. Use 0 to only retrieve 728 * top-level pages. 729 * @type int[] $post_parent__in An array containing parent page IDs to query child pages from. 730 * @type int[] $post_parent__not_in An array containing parent page IDs not to query child pages from. 731 * @type string|array $post_type A post type slug (string) or array of post type slugs. 732 * Default 'any' if using 'tax_query'. 733 * @type string|array $post_status A post status (string) or array of post statuses. 734 * @type int $posts_per_page The number of posts to query for. Use -1 to request all posts. 735 * @type int $posts_per_archive_page The number of posts to query for by archive page. Overrides 736 * 'posts_per_page' when is_archive(), or is_search() are true. 737 * @type string $s Search keyword(s). Prepending a term with a hyphen will 738 * exclude posts matching that term. Eg, 'pillow -sofa' will 739 * return posts containing 'pillow' but not 'sofa'. The 740 * character used for exclusion can be modified using the 741 * the 'wp_query_search_exclusion_prefix' filter. 742 * @type int $second Second of the minute. Default empty. Accepts numbers 0-59. 743 * @type bool $sentence Whether to search by phrase. Default false. 744 * @type bool $suppress_filters Whether to suppress filters. Default false. 745 * @type string $tag Tag slug. Comma-separated (either), Plus-separated (all). 746 * @type int[] $tag__and An array of tag IDs (AND in). 747 * @type int[] $tag__in An array of tag IDs (OR in). 748 * @type int[] $tag__not_in An array of tag IDs (NOT in). 749 * @type int $tag_id Tag id or comma-separated list of IDs. 750 * @type string[] $tag_slug__and An array of tag slugs (AND in). 751 * @type string[] $tag_slug__in An array of tag slugs (OR in). unless 'ignore_sticky_posts' is 752 * true. Note: a string of comma-separated IDs will NOT work. 753 * @type array $tax_query An associative array of WP_Tax_Query arguments. 754 * See WP_Tax_Query->__construct(). 755 * @type string $title Post title. 756 * @type bool $update_post_meta_cache Whether to update the post meta cache. Default true. 757 * @type bool $update_post_term_cache Whether to update the post term cache. Default true. 758 * @type bool $lazy_load_term_meta Whether to lazy-load term meta. Setting to false will 759 * disable cache priming for term meta, so that each 760 * get_term_meta() call will hit the database. 761 * Defaults to the value of `$update_post_term_cache`. 762 * @type int $w The week number of the year. Default empty. Accepts numbers 0-53. 763 * @type int $year The four-digit year. Default empty. Accepts any four-digit year. 745 764 * } 746 765 */
Note: See TracChangeset
for help on using the changeset viewer.