Un motore di ricerca WordPress per sviluppatori e autori di temi



get_page_templates ›

Da1.5.0
Deprecaton/a
get_page_templates ( $post = null, $post_type = 'page' )
Parametri: (2)
  • (WP_Post|null) $post Optional. The post being edited, provided for context.
    Richiesto: No
    Default: null
  • (string) $post_type Optional. Post type to get the templates for. Default 'page'.
    Richiesto: No
    Default: 'page'
Ritorna:
  • (array) Key is the template name, value is the filename of the template
Definito a:
Codex:
ChangeLog:
  • 4.7.0

Get the Page Templates available in this theme



Sorgenti

function get_page_templates( $post = null, $post_type = 'page' ) {
	return array_flip( wp_get_theme()->get_page_templates( $post, $post_type ) );
}