Accept array of pages for is_page(). Props azaozz. fixes #5430

git-svn-id: http://svn.automattic.com/wordpress/trunk@6397 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2007-12-17 06:21:43 +00:00
parent 9572687394
commit 1d9a4211dc
1 changed files with 5 additions and 3 deletions

View File

@ -152,11 +152,13 @@ function is_page ($page = '') {
$page_obj = $wp_query->get_queried_object();
if ( $page == $page_obj->ID )
$page = (array) $page;
if ( in_array( $page_obj->ID, $page ) )
return true;
elseif ( $page == $page_obj->post_title )
elseif ( in_array( $page_obj->post_title, $page ) )
return true;
else if ( $page == $page_obj->post_name )
else if ( in_array( $page_obj->post_name, $page ) )
return true;
return false;