首页 WordPress函数大全 get_page_templates()

get_page_templates()

2020-05-01 / 2996阅 / 悠然

如何你看完本文还不知道如何使用该函数,可以联系我定制视频教程,50元/个函数,学不会全额退款

get_page_templates( WP_Post|null $post = null, string $post_type = 'page' )

Gets the page templates available in this theme.

描述

参数

$post

(WP_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.

大家谈论
    我的见解