get_template_part

动作钩子


do_action( 'get_template_part', $slug, $name, $templates, $args )
参数
  • (string)
    $slug
    The slug name for the generic template.
    Required:
  • (string)
    $name
    The name of the specialized template.
    Required:
  • (string[])
    $templates
    Array of template files to search for, in order.
    Required:
  • (array)
    $args
    Additional arguments passed to the template.
    Required:
定义位置
  • wp-includes/general-template.php
    , line 202
引入
5.5.0
弃用

在试图定位和加载模板零件之前发生触发。

do_action( 'get_template_part', $slug, $name, $templates, $args );