WordPress как на ладони
wordpress jino
фильтр не описан

customize_dynamic_partial_args хук-фильтр . WP 4.5.0

Filters a dynamic partial's constructor arguments.

For a dynamic partial to be registered, this filter must be employed to override the default false value with an array of args to pass to the WP_Customize_Partial constructor.

Использование

add_filter( 'customize_dynamic_partial_args', 'filter_function_name_4445', 10, 2 );
function filter_function_name_4445( $partial_args, $partial_id ){
	// filter...

	return $partial_args;
}
$partial_args(false|array)
The arguments to the WP_Customize_Partial constructor.
$partial_id(string)
ID for dynamic partial.

Связи хука

Используется в: WP_Customize_Selective_Refresh::add_partial(), WP_Customize_Selective_Refresh::add_dynamic_partials()

Остальные хуки из: WP_Customize_Selective_Refresh::add_partial():

Остальные хуки из: WP_Customize_Selective_Refresh::add_dynamic_partials():

Кусок кода с хуком

...
	 *  @type bool     $container_inclusive   Whether the container element is included in the partial, or if only
	 *                                        the contents are rendered.
	 *  @type bool     $fallback_refresh      Whether to refresh the entire preview in case a partial cannot be refreshed.
	 *                                        A partial render is considered a failure if the render_callback returns
	 *                                        false.
	 * }
	 * @return WP_Customize_Partial             The instance of the panel that was added.
	 */
	public function add_partial( $id, $args = array() ) {
		if ( $id instanceof WP_Customize_Partial ) {
			$partial = $id;
		} else {
			$class = 'WP_Customize_Partial';

			/** This filter is documented in wp-includes/customize/class-wp-customize-selective-refresh.php */
			$args = apply_filters( 'customize_dynamic_partial_args', $args, $id );

			/** This filter is documented in wp-includes/customize/class-wp-customize-selective-refresh.php */
			$class = apply_filters( 'customize_dynamic_partial_class', $class, $id, $args );

			$partial = new $class( $this, $id, $args );
		}

		$this->partials[ $partial->id ] = $partial;
		return $partial;
	}

	/**
	 * Retrieves a partial.
	 *
	 * @since 4.5.0
...
...
			$partial_args = false;
			$partial_class = 'WP_Customize_Partial';

			/**
			 * Filters a dynamic partial's constructor arguments.
			 *
			 * For a dynamic partial to be registered, this filter must be employed
			 * to override the default false value with an array of args to pass to
			 * the WP_Customize_Partial constructor.
			 *
			 * @since 4.5.0
			 *
			 * @param false|array $partial_args The arguments to the WP_Customize_Partial constructor.
			 * @param string      $partial_id   ID for dynamic partial.
			 */
			$partial_args = apply_filters( 'customize_dynamic_partial_args', $partial_args, $partial_id );
			if ( false === $partial_args ) {
				continue;
			}

			/**
			 * Filters the class used to construct partials.
			 *
			 * Allow non-statically created partials to be constructed with custom WP_Customize_Partial subclass.
			 *
			 * @since 4.5.0
			 *
			 * @param string $partial_class WP_Customize_Partial or a subclass.
			 * @param string $partial_id    ID for dynamic partial.
			 * @param array  $partial_args  The arguments to the WP_Customize_Partial constructor.
			 */
...