Does anybody know why this works:
if ( is_page( array( 'home', 'contact' ) ) ) {}
But this doesn’t:
$pages = array( 'home', 'contact' );
if ( is_page( $pages ) ) {}
Even when adding settype( $pages, 'array');
Does anybody know why this works:
if ( is_page( array( 'home', 'contact' ) ) ) {}
But this doesn’t:
$pages = array( 'home', 'contact' );
if ( is_page( $pages ) ) {}
Even when adding settype( $pages, 'array');