wpseek.com
Uma área de pesquisa sobre o WordPress para devs e autores do tema



get_page_templates › WordPress Function

Desde1.5.0
Obsoleton/a
get_page_templates ( $post = null, $post_type = 'page' )
Parâmetros: (2)
  • (WP_Post|null) $post Optional. The post being edited, provided for context.
    Required: No
    Padrão: null
  • (string) $post_type Optional. Post type to get the templates for. Default 'page'.
    Required: No
    Padrão: 'page'
Retorna:
  • (string[]) Array of template file names keyed by the template header name.
Definido em:
Codex:
Log de mudanças:
  • 4.7.0

Gets the page templates available in this theme.



Fonte

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