get_template_part_{$slug}
do_action( “get_template_part_{$slug}”, string $slug , string|null $name )
操作挂钩:在加载指定的模板部件文件之前激发。
Action Hook: Fires before the specified template part file is loaded.
说明(Description)
钩子名的动态部分,$slug,指的是通用模板部分的slug名。
参数(Parameters)
参数 | 类型 | 说明 |
---|---|---|
$slug | (string) | 通用模板的slug名称。 |
$name | (string | null) | 专用模板的名称。 |
源码(Source)
更新版本 | 源码位置 | 使用 | 被使用 |
---|---|---|---|
3.0.0 | wp-includes/general-template.php:147 | 1 | 0 |
get_template_part_{$slug} 为WP2原创文章,链接:https://www.wp2.cn/hook/get_template_part_slug/