get_page_templates() WP 1.0
Get the Page Templates available in this theme
- Since 4.7.0 Added the
$post_type
parameter.
Is the basis for:
page_template_dropdown()
Works based on:
WP_Theme::get_page_templates()
No Hooks.
Return
Array. Key is the template name, value is the filename of the template
Usage
get_page_templates( $post, $post_type );
- $post(WP_Post/null)
- The post being edited, provided for context.
Default:null
- $post_type(string)
- Post type to get the templates for.
Default: 'page'
Code of get page templates:
wp-admin/includes/theme.php
VER 5.0.3
Related Functions
From category: Other Theme Functions
- add_theme_support()
- bloginfo()
- body_class()
- current_theme_supports()
- get_custom_header_markup()
- get_custom_logo()
- get_header_image()
- get_header_image_tag()
- get_header_textcolor()
- get_header_video_url()
- get_post_class()
- get_query_template()
- get_stylesheet()
- get_template()
- get_theme_mod()
- get_theme_mods()
- get_theme_root()
- has_custom_logo()
- has_header_image()
- has_header_video()
- is_child_theme()
- is_header_video_active()
- is_multi_author()
- post_class()
- register_nav_menu()
- register_nav_menus()
- register_theme_directory()
- remove_theme_mod()
- remove_theme_mods()
- remove_theme_support()
- search_theme_directories()
- set_theme_mod()
- single_month_title()
- the_custom_header_markup()