函数原型
get_template_part( string $slug, string $name = null, array $args = array() ): void|false
函数描述
Loads a template part into a template.
是否弃用
未弃用
函数参数
-
$slug
string
Required - The slug name for the generic template.
-
$name
string
Optional - The name of the specialised template.
Default:
null -
$args
array
Optional - Additional arguments passed to the template.
Default:
array()
函数返回值
void|false Void on success, false if the template does not exist.
函数位置
File: wp-includes/general-template.php.
函数源码
get_template_part( $slug );源码链接
变更日志
| Version | Description |
|---|---|
| 5.5.0 | The $args parameter was added. |
| 3.0.0 | Introduced. |

