Forums

[resolved] does is_page_template() accept arrays (4 posts)

  1. helgatheviking
    Member
    Posted 2 years ago #

    does the conditional is_page_template() accept arrays?

    is_page_template( array('about.php','template-page-test.php') )

    i read this somewhere, (not in the Codex- though the Codex suggests that arrays are accepted by is_page). it seems like they ought to accept the same types of inputs, but cannot seem to make it work.

  2. Rahul Sonar
    Member
    Posted 2 years ago #

    is_page_template does not accepts array as argument, you need to provide a string..

  3. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    the conditional is_page_template() does not accept arrays;
    as far as i can judge this from looking into the core files.
    /wp-includes/post-template.php (line 1220+)

    is_page() does indeed accept arrays.

  4. helgatheviking
    Member
    Posted 2 years ago #

    thanks everyone. my attempts to use arrays were failing, i just wanted to verify. bummer, would be cool if it took arrays like is_page().

Topic Closed

This topic has been closed to new replies.

About this Topic