get_page_templates()

最后更新于:2021-11-26 11:12:24

get_page_templates( GC_Post|null$post=null, string$post_type=’page’)

Gets the page templates available in this theme.

参数

$post

(GC_Post|null) (Optional) The post being edited, provided for context.

Default value: null

$post_type

(string) (Optional) Post type to get the templates for.

Default value: ‘page’

响应

(string[]) Array of template file names keyed by the template header name.

源文件

文件: gc-admin/includes/theme.php

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