customize_dynamic_partial_class WordPress Filter Hook
The customize_dynamic_partial_class hook allows you to change the class used to identify a dynamic partial. A dynamic partial is a partial that is rendered using the render_partial() function. By default, the class used to identify a dynamic partial is 'WP_Customize_Partial'. However, if you want to use a different class for your dynamic partial, you can use the customize_dynamic_partial_class hook. For example, if you want to use the 'My_Custom_Partial' class for your dynamic partial, you would use the following code: function my_customize_dynamic_partial_class( $class ) { return 'My_Custom_Partial'; } add_filter( 'customize_dynamic_partial_class', 'my_customize_dynamic_partial_class' );
apply_filters( 'customize_dynamic_partial_class', string $partial_class , string $partial_id , array $partial_args ) #
Filters the class used to construct partials.
Description
Allow non-statically created partials to be constructed with custom WP_Customize_Partial subclass.
Parameters
- $partial_class
(string)WP_Customize_Partial or a subclass.
- $partial_id
(string)ID for dynamic partial.
- $partial_args
(array)The arguments to the WP_Customize_Partial constructor.
Source
File: wp-includes/customize/class-wp-customize-selective-refresh.php
Changelog
Version | Description |
---|---|
4.5.0 | Introduced. |