WP_Customize_Widgets::customize_dynamic_partial_args() WordPress Method
The WP_Customize_Widgets::customize_dynamic_partial_args() method is used to filter the arguments used when constructing a dynamic partial.
WP_Customize_Widgets::customize_dynamic_partial_args( array|false $partial_args, string $partial_id ) #
Filters arguments for dynamic widget partials.
Parameters
- $partial_args
(array|false)(Required)Partial arguments.
- $partial_id
(string)(Required)Partial ID.
Return
(array) (Maybe) modified partial arguments.
Source
File: wp-includes/class-wp-customize-widgets.php
public function customize_dynamic_partial_args( $partial_args, $partial_id ) { if ( ! current_theme_supports( 'customize-selective-refresh-widgets' ) ) { return $partial_args; } if ( preg_match( '/^widget\[(?P<widget_id>.+)\]$/', $partial_id, $matches ) ) { if ( false === $partial_args ) { $partial_args = array(); } $partial_args = array_merge( $partial_args, array( 'type' => 'widget', 'render_callback' => array( $this, 'render_widget_partial' ), 'container_inclusive' => true, 'settings' => array( $this->get_setting_id( $matches['widget_id'] ) ), 'capability' => 'edit_theme_options', ) ); } return $partial_args; }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
4.5.0 | Introduced. |