Title: WP_Customize_Widgets::customize_dynamic_partial_args
Published: April 12, 2016
Last modified: May 20, 2026

---

# WP_Customize_Widgets::customize_dynamic_partial_args( array|false $partial_args, string $partial_id ): array

## In this article

 * [Parameters](https://developer.wordpress.org/reference/classes/wp_customize_widgets/customize_dynamic_partial_args/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/classes/wp_customize_widgets/customize_dynamic_partial_args/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/wp_customize_widgets/customize_dynamic_partial_args/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/wp_customize_widgets/customize_dynamic_partial_args/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_customize_widgets/customize_dynamic_partial_args/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_customize_widgets/customize_dynamic_partial_args/?output_format=md#wp--skip-link--target)

Filters arguments for dynamic widget partials.

## 󠀁[Parameters](https://developer.wordpress.org/reference/classes/wp_customize_widgets/customize_dynamic_partial_args/?output_format=md#parameters)󠁿

 `$partial_args`array|falserequired

Partial arguments.

`$partial_id`stringrequired

Partial ID.

## 󠀁[Return](https://developer.wordpress.org/reference/classes/wp_customize_widgets/customize_dynamic_partial_args/?output_format=md#return)󠁿

 array (Maybe) modified partial arguments.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_customize_widgets/customize_dynamic_partial_args/?output_format=md#source)󠁿

    ```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;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-customize-widgets.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/class-wp-customize-widgets.php#L1767)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/class-wp-customize-widgets.php#L1767-L1789)

## 󠀁[Related](https://developer.wordpress.org/reference/classes/wp_customize_widgets/customize_dynamic_partial_args/?output_format=md#related)󠁿

| Uses | Description | 
| [WP_Customize_Widgets::get_setting_id()](https://developer.wordpress.org/reference/classes/wp_customize_widgets/get_setting_id/)`wp-includes/class-wp-customize-widgets.php` |

Converts a widget_id into its corresponding Customizer setting ID (option name).

  | 
| [current_theme_supports()](https://developer.wordpress.org/reference/functions/current_theme_supports/)`wp-includes/theme.php` |

Checks a theme’s support for a given feature.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/wp_customize_widgets/customize_dynamic_partial_args/?output_format=md#changelog)󠁿

| Version | Description | 
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_customize_widgets%2Fcustomize_dynamic_partial_args%2F)
before being able to contribute a note or feedback.