GC_Customize_Nav_Menus::customize_dynamic_partial_args()
最后更新于:2021-11-27 03:48:04
GC_Customize_Nav_Menus::customize_dynamic_partial_args( array|false$partial_args, string$partial_id)Filters arguments for dynamic nav_menu selective refresh partials.
参数
- $partial_args
-
(array|false) (Required) Partial args.
- $partial_id
-
(string) (Required) Partial ID.
响应
(array) Partial args.
源文件
文件: gc-includes/class-gc-customize-nav-menus.php
public function customize_dynamic_partial_args( $partial_args, $partial_id ) {
if ( preg_match( '/^nav_menu_instance[[0-9a-f]{32}]$/', $partial_id ) ) {
if ( false === $partial_args ) {
$partial_args = array();
}
$partial_args = array_merge(
$partial_args,
array(
'type' => 'nav_menu_instance',
'render_callback' => array( $this, 'render_nav_menu_partial' ),
'container_inclusive' => true,
'settings' => array(), // Empty because the nav menu instance may relate to a menu or a location.
'capability' => 'edit_theme_options',
)
);
}
return $partial_args;
}