Ticket #31723: 31723.diff
File 31723.diff, 1.5 KB (added by , 8 years ago) |
---|
-
src/wp-includes/query.php
485 485 * @param mixed $page Page ID, title, slug, or array of such. 486 486 * @return bool 487 487 */ 488 function is_page( $page = '') {488 function is_page( $page = null ) { 489 489 global $wp_query; 490 490 491 491 if ( ! isset( $wp_query ) ) { … … 594 594 * @param mixed $post Post ID, title, slug, or array of such. 595 595 * @return bool 596 596 */ 597 function is_single( $post = '') {597 function is_single( $post = null ) { 598 598 global $wp_query; 599 599 600 600 if ( ! isset( $wp_query ) ) { … … 4359 4359 * @param mixed $page Page ID, title, slug, path, or array of such. 4360 4360 * @return bool 4361 4361 */ 4362 public function is_page( $page = '') {4363 if ( ! $this->is_page )4362 public function is_page( $page = null ) { 4363 if ( ! $this->is_page ) 4364 4364 return false; 4365 4365 4366 if ( empty( $page ) )4366 if ( is_null($page) ) { 4367 4367 return true; 4368 } 4368 4369 4370 if (empty( $page) ) 4371 return false; 4372 4373 4369 4374 $page_obj = $this->get_queried_object(); 4370 4375 4371 4376 $page = (array) $page; … … 4452 4457 * @param mixed $post Post ID, title, slug, path, or array of such. 4453 4458 * @return bool 4454 4459 */ 4455 public function is_single( $post = '') {4460 public function is_single( $post = null ) { 4456 4461 if ( !$this->is_single ) 4457 4462 return false; 4458 4463 4459 if ( empty($post) )4464 if ( is_null($post) ) 4460 4465 return true; 4461 4466 4467 if ( empty($post)) 4468 return false; 4469 4462 4470 $post_obj = $this->get_queried_object(); 4463 4471 4464 4472 $post = (array) $post;