WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
This hook occurs 2 times in this file.
Line | Code |
---|---|
93 | * @return WP_Customize_Partial The instance of the partial that was added. |
94 | */ |
95 | public function add_partial( $id, $args = array() ) { |
96 | if ( $id instanceof WP_Customize_Partial ) { |
97 | $partial = $id; |
98 | } else { |
99 | $class = 'WP_Customize_Partial'; |
100 |
|
101 | /** This filter is documented in wp-includes/customize/class-wp-customize-selective-refresh.php */ |
102 | $args = apply_filters( 'customize_dynamic_partial_args', $args, $id ); |
103 |
|
104 | /** This filter is documented in wp-includes/customize/class-wp-customize-selective-refresh.php */ |
105 | $class = apply_filters( 'customize_dynamic_partial_class', $class, $id, $args ); |
106 |
|
107 | $partial = new $class( $this, $id, $args ); |
108 | } |
109 |
|
110 | $this->partials[ $partial->id ] = $partial; |
111 | return $partial; |
Line | Code |
226 | * For a dynamic partial to be registered, this filter must be employed |
227 | * to override the default false value with an array of args to pass to |
228 | * the WP_Customize_Partial constructor. |
229 | * |
230 | * @since 4.5.0 |
231 | * |
232 | * @param false|array $partial_args The arguments to the WP_Customize_Partial constructor. |
233 | * @param string $partial_id ID for dynamic partial. |
234 | */ |
235 | $partial_args = apply_filters( 'customize_dynamic_partial_args', $partial_args, $partial_id ); |
236 | if ( false === $partial_args ) { |
237 | continue; |
238 | } |
239 |
|
240 | /** |
241 | * Filters the class used to construct partials. |
242 | * |
243 | * Allow non-statically created partials to be constructed with custom WP_Customize_Partial subclass. |
244 | * |