Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: customize_dynamic_partial_args

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       * @return WP_Customize_Partial             The instance of the panel that was added.
96       */
97      public function add_partial( $id, $args = array() ) {
98           if ( $id instanceof WP_Customize_Partial ) {
99                $partial = $id;
100           } else {
101                $class = 'WP_Customize_Partial';
102
103                /** This filter (will be) documented in wp-includes/class-wp-customize-manager.php */
104                $args = apply_filters( 'customize_dynamic_partial_args', $args, $id );
105
106                /** This filter (will be) documented in wp-includes/class-wp-customize-manager.php */
107                $class = apply_filters( 'customize_dynamic_partial_class', $class, $id, $args );
108
109                $partial = new $class( $this, $id, $args );
110           }
111
112           $this->partials[ $partial->id ] = $partial;
113           return $partial;
 
Line Code
224                 * For a dynamic partial to be registered, this filter must be employed
225                 * to override the default false value with an array of args to pass to
226                 * the WP_Customize_Partial constructor.
227                 *
228                 * @since 4.5.0
229                 *
230                 * @param false|array $partial_args The arguments to the WP_Customize_Partial constructor.
231                 * @param string      $partial_id   ID for dynamic partial.
232                 */
233                $partial_args = apply_filters( 'customize_dynamic_partial_args', $partial_args, $partial_id );
234                if ( false === $partial_args ) {
235                     continue;
236                }
237
238                /**
239                 * Filters the class used to construct partials.
240                 *
241                 * Allow non-statically created partials to be constructed with custom WP_Customize_Partial subclass.
242                 *