TransWikia.com

Weird issue with is_pages() with array

WordPress Development Asked by birdseyedesign on December 11, 2020

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');

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP