Changeset 38356
- Timestamp:
- 08/25/2016 07:41:42 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-query.php
r38351 r38356 15 15 * @since 1.5.0 16 16 * @since 4.5.0 Removed the `$comments_popup` property. 17 * 18 * @method bool is_archive() Is the query for an existing archive page? Month, Year, Category, Author, Post Type archive... 19 * @method bool is_date() Is the query for an existing date archive? 20 * @method bool is_day() Is the query for an existing day archive? 21 * @method bool is_comment_feed() Is the query for a comments feed? 22 * @method bool is_month() Is the query for an existing month archive? 23 * @method bool is_paged() Is the query for paged result and not for the first page? 24 * @method bool is_preview() Is the query for a post or page preview? 25 * @method bool is_robots() Is the query for the robots file? 26 * @method bool is_search() Is the query for a search? 27 * @method bool is_time() Is the query for a specific time? 28 * @method bool is_trackback() Is the query for a trackback endpoint call? 29 * @method bool is_year() Is the query for an existing year archive? 30 * @method bool is_404() Is the query a 404 (returns no results)? 31 * @method bool is_embed() Is the query for an embedded post? 17 32 */ 18 33 class WP_Query { … … 3382 3397 return call_user_func_array( array( $this, $name ), $arguments ); 3383 3398 } 3399 3400 if ( 'is_' === substr( $name, 0, 3 ) && property_exists( $this, $name ) ) { 3401 return (bool) $this->{$name}; 3402 } 3403 3384 3404 return false; 3385 }3386 3387 /**3388 * Is the query for an existing archive page?3389 *3390 * Month, Year, Category, Author, Post Type archive...3391 *3392 * @since 3.1.03393 *3394 * @return bool3395 */3396 public function is_archive() {3397 return (bool) $this->is_archive;3398 3405 } 3399 3406 … … 3603 3610 3604 3611 return false; 3605 }3606 3607 /**3608 * Is the query for an existing date archive?3609 *3610 * @since 3.1.03611 *3612 * @return bool3613 */3614 public function is_date() {3615 return (bool) $this->is_date;3616 }3617 3618 /**3619 * Is the query for an existing day archive?3620 *3621 * @since 3.1.03622 *3623 * @return bool3624 */3625 public function is_day() {3626 return (bool) $this->is_day;3627 3612 } 3628 3613 … … 3642 3627 $qv = get_default_feed(); 3643 3628 return in_array( $qv, (array) $feeds ); 3644 }3645 3646 /**3647 * Is the query for a comments feed?3648 *3649 * @since 3.1.03650 *3651 * @return bool3652 */3653 public function is_comment_feed() {3654 return (bool) $this->is_comment_feed;3655 3629 } 3656 3630 … … 3699 3673 public function is_home() { 3700 3674 return (bool) $this->is_home; 3701 }3702 3703 /**3704 * Is the query for an existing month archive?3705 *3706 * @since 3.1.03707 *3708 * @return bool3709 */3710 public function is_month() {3711 return (bool) $this->is_month;3712 3675 } 3713 3676 … … 3760 3723 3761 3724 /** 3762 * Is the query for paged result and not for the first page?3763 *3764 * @since 3.1.03765 *3766 * @return bool3767 */3768 public function is_paged() {3769 return (bool) $this->is_paged;3770 }3771 3772 /**3773 * Is the query for a post or page preview?3774 *3775 * @since 3.1.03776 *3777 * @return bool3778 */3779 public function is_preview() {3780 return (bool) $this->is_preview;3781 }3782 3783 /**3784 * Is the query for the robots file?3785 *3786 * @since 3.1.03787 *3788 * @return bool3789 */3790 public function is_robots() {3791 return (bool) $this->is_robots;3792 }3793 3794 /**3795 * Is the query for a search?3796 *3797 * @since 3.1.03798 *3799 * @return bool3800 */3801 public function is_search() {3802 return (bool) $this->is_search;3803 }3804 3805 /**3806 3725 * Is the query for an existing single post? 3807 3726 * … … 3872 3791 3873 3792 return in_array( $post_obj->post_type, (array) $post_types ); 3874 }3875 3876 /**3877 * Is the query for a specific time?3878 *3879 * @since 3.1.03880 *3881 * @return bool3882 */3883 public function is_time() {3884 return (bool) $this->is_time;3885 }3886 3887 /**3888 * Is the query for a trackback endpoint call?3889 *3890 * @since 3.1.03891 *3892 * @return bool3893 */3894 public function is_trackback() {3895 return (bool) $this->is_trackback;3896 }3897 3898 /**3899 * Is the query for an existing year archive?3900 *3901 * @since 3.1.03902 *3903 * @return bool3904 */3905 public function is_year() {3906 return (bool) $this->is_year;3907 }3908 3909 /**3910 * Is the query a 404 (returns no results)?3911 *3912 * @since 3.1.03913 *3914 * @return bool3915 */3916 public function is_404() {3917 return (bool) $this->is_404;3918 }3919 3920 /**3921 * Is the query for an embedded post?3922 *3923 * @since 4.4.03924 *3925 * @return bool3926 */3927 public function is_embed() {3928 return (bool) $this->is_embed;3929 3793 } 3930 3794
Note: See TracChangeset
for help on using the changeset viewer.