get_page_templates


get_page_templates ( $post = null, $post_type = 'page' )

Parameters:
  • (WP_Post|null) post Optional. The post being edited, provided for context.
  • (string) post_type Optional. Post type to get the templates for. Default 'page'.
Returns:
  • (string[]) Array of template file names keyed by the template header name.
Defined at:
Change Log:
  • 4: .

Description

Gets the page templates available in this theme.

Related Functions

get_page_template, get_paged_template, get_page_template_slug, get_tag_template, get_date_template

Top Google Results

User discussions

wpseek mobile