Created
April 6, 2020 15:36
-
-
Save ajskelton/b358fa7e58c303314f7b2fe962a651f8 to your computer and use it in GitHub Desktop.
Test for pages using a specific Page Template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function test_for_page_template() { | |
$args = array( | |
'post_type' => 'page', | |
'meta_query' => array( | |
array( | |
'key' => '_wp_page_template', | |
'value' => 'PAGETEMPLATE.php' | |
) | |
) | |
); | |
$query = new WP_Query( $args ); | |
dump_and_die($query); | |
} | |
add_action('init', 'test_for_page_template'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment