Docs: Add more explicit optional parameter types and return descriptions in the DocBlocks for `is_page()`, `is_single()`, `is_singular()`.

Also adds explicit types and return descriptions to the corresponding `WP_Query` methods: `WP_Query::is_page()`, `WP_Query::is_single()`, and `WP_Query::is_singular()`.

Props Shelob9 for the initial patch.
Fixes #33907.

Built from https://develop.svn.wordpress.org/trunk@34502


git-svn-id: http://core.svn.wordpress.org/trunk@34466 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Drew Jaynes 2015-09-24 16:18:24 +00:00
parent 38b561e8df
commit b818747870
2 changed files with 13 additions and 13 deletions

View File

@ -488,8 +488,8 @@ function is_month() {
*
* @global WP_Query $wp_query Global WP_Query instance.
*
* @param mixed $page Page ID, title, slug, or array of such.
* @return bool
* @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.
*/
function is_page( $page = '' ) {
global $wp_query;
@ -597,8 +597,8 @@ function is_search() {
*
* @global WP_Query $wp_query Global WP_Query instance.
*
* @param mixed $post Post ID, title, slug, or array of such.
* @return bool
* @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.
*/
function is_single( $post = '' ) {
global $wp_query;
@ -624,8 +624,8 @@ function is_single( $post = '' ) {
*
* @global WP_Query $wp_query Global WP_Query instance.
*
* @param mixed $post_types Optional. Post Type or array of Post Types
* @return bool
* @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.
*/
function is_singular( $post_types = '' ) {
global $wp_query;
@ -4406,8 +4406,8 @@ class WP_Query {
*
* @since 3.1.0
*
* @param mixed $page Page ID, title, slug, path, or array of such.
* @return bool
* @param int|string|array $page Optional. Page ID, title, slug, path, or array of such. Default empty.
* @return bool Whether the query is for an existing single page.
*/
public function is_page( $page = '' ) {
if ( !$this->is_page )
@ -4499,8 +4499,8 @@ class WP_Query {
*
* @since 3.1.0
*
* @param mixed $post Post ID, title, slug, path, or array of such.
* @return bool
* @param int|string|array $post Optional. Post ID, title, slug, path, or array of such. Default empty.
* @return bool Whether the query is for an existing single post.
*/
public function is_single( $post = '' ) {
if ( !$this->is_single )
@ -4545,8 +4545,8 @@ class WP_Query {
*
* @since 3.1.0
*
* @param mixed $post_types Optional. Post Type or array of Post Types
* @return bool
* @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.
*/
public function is_singular( $post_types = '' ) {
if ( empty( $post_types ) || !$this->is_singular )

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.4-alpha-34501';
$wp_version = '4.4-alpha-34502';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.