Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: customize_dynamic_partial_class

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

This hook occurs 2 times in this file.

Line Code
95           if ( $id instanceof WP_Customize_Partial ) {
96                $partial = $id;
97           } else {
98                $class = 'WP_Customize_Partial';
99
100                /** This filter is documented in wp-includes/customize/class-wp-customize-selective-refresh.php */
101                $args = apply_filters( 'customize_dynamic_partial_args', $args, $id );
102
103                /** This filter is documented in wp-includes/customize/class-wp-customize-selective-refresh.php */
104                $class = apply_filters( 'customize_dynamic_partial_class', $class, $id, $args );
105
106                $partial = new $class( $this, $id, $args );
107           }
108
109           $this->partials[ $partial->id ] = $partial;
110           return $partial;
111      }
112
113      /**
 
Line Code
241                 *
242                 * Allow non-statically created partials to be constructed with custom WP_Customize_Partial subclass.
243                 *
244                 * @since 4.5.0
245                 *
246                 * @param string $partial_class WP_Customize_Partial or a subclass.
247                 * @param string $partial_id    ID for dynamic partial.
248                 * @param array  $partial_args  The arguments to the WP_Customize_Partial constructor.
249                 */
250                $partial_class = apply_filters( 'customize_dynamic_partial_class', $partial_class, $partial_id, $partial_args );
251
252                $partial = new $partial_class( $this, $partial_id, $partial_args );
253
254                $this->add_partial( $partial );
255                $new_partials[] = $partial;
256           }
257           return $new_partials;
258      }
259