WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

WP_Customize_Selective_Refresh::add_partial() public WP 4.5.0

Adds a partial.

Это метод класса: WP_Customize_Selective_Refresh{}

Возвращает

WP_Customize_Partial. The instance of the partial that was added.

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

$WP_Customize_Selective_Refresh = new WP_Customize_Selective_Refresh();
$WP_Customize_Selective_Refresh->add_partial( $id, $args );
$id(WP_Customize_Partial/строка) (обязательный)
Customize Partial object, or Partial ID.
$args(массив)
Array of properties for the new Partials object. See WP_Customize_Partial::__construct() for information on accepted arguments.
По умолчанию: empty array

Заметки

  • Смотрите: WP_Customize_Partial::__construct()

Список изменений

С версии 4.5.0 Введена.

Код WP_Customize_Selective_Refresh::add_partial() WP 5.5.1

wp-includes/customize/class-wp-customize-selective-refresh.php
<?php
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;
}