wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi



get_page_templates › WordPress Function

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:
  • (string[]) Array of template file names keyed by the template header name.
Definito a:
Codex:
ChangeLog:
  • 4.7.0

Gets 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 ) );
}