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

WP_Customize_Manager::prepare_setting_validity_for_js() WP 4.6.0

Prepares setting validity for exporting to the client (JS).

Converts WP_Error instance into array suitable for passing into the wp.customize.Notification JS model.

Это метод класса: WP_Customize_Manager

Хуков нет.

Возвращает

true/Массив. If $validity was a WP_Error, the error codes will be array-mapped to their respective message and data to pass into the wp.customize.Notification JS model.

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

$WP_Customize_Manager = new WP_Customize_Manager();
$var = $WP_Customize_Manager->prepare_setting_validity_for_js( $validity );
$validity(true/WP_Error) (обязательный)
Setting validity.

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

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

Код WP Customize Manager::prepare setting validity for js: wp-includes/class-wp-customize-manager.php WP 5.3.2

<?php
public function prepare_setting_validity_for_js( $validity ) {
	if ( is_wp_error( $validity ) ) {
		$notification = array();
		foreach ( $validity->errors as $error_code => $error_messages ) {
			$notification[ $error_code ] = array(
				'message' => join( ' ', $error_messages ),
				'data'    => $validity->get_error_data( $error_code ),
			);
		}
		return $notification;
	} else {
		return true;
	}
}