I'm trying to do something like this: Hide a page in the admin end without a plugin?
However, I don't want to hardcode the page-ids. I want to get the page id's based on template-name.
$pages = get_posts(array(
'post_type' => 'page',
'meta_key' => '_wp_page_template',
'meta_value' => 'product.php'
));
^^This probably does the job, but it gets entire pages, and I start worrying about efficiency, especially when I only need id's and there could be thousands of pages being returned by this command.
I know SQL pretty well, so if I should just write my own query, then let me know.
Or maybe I don't need to worry about this at all?