get_file_data() is more strict than get_page_templates() was in 3.3
|Reported by:||nacin||Owned by:|
get_page_templates() read in a file's contents and then matched '|Template Name:(.*)$|mi'. get_file_data() is much more strict about what it will accept. In particular, this will not work:
<?php /* Template Name: My Template */ ?>
I like the idea of using get_file_data(), but I don't know if it will be tenable to keep using it. We can revert to the same operations in 3.3 inside WP_Theme->get_page_templates() and be much safer.
Change History (8)
- Keywords has-patch commit added; needs-patch needs-unit-tests removed