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

WP_Paused_Extensions_Storage::set() WP 5.2.0

Records an extension error.

Only one error is stored per extension, with subsequent errors for the same extension overriding the previously stored error.

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

Хуков нет.

Возвращает

true/false. True on success, false on failure.

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

$WP_Paused_Extensions_Storage = new WP_Paused_Extensions_Storage();
$var = $WP_Paused_Extensions_Storage->set( $extension, $error );
$extension(строка) (обязательный)
Plugin or theme directory name.
$error(массив) (обязательный)

Error that was triggered.

  • $type (строка)
    The error type.

  • $file (строка)
    The name of the file in which the error occurred.

  • $line (строка)
    The line number in which the error occurred.

  • $message (строка)
    The error message.

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

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

Код WP Paused Extensions Storage::set: wp-includes/class-wp-paused-extensions-storage.php WP 5.3.2

<?php
public function set( $extension, $error ) {
	if ( ! $this->is_api_loaded() ) {
		return false;
	}

	$option_name = $this->get_option_name();

	if ( ! $option_name ) {
		return false;
	}

	$paused_extensions = (array) get_option( $option_name, array() );

	// Do not update if the error is already stored.
	if ( isset( $paused_extensions[ $this->type ][ $extension ] ) && $paused_extensions[ $this->type ][ $extension ] === $error ) {
		return true;
	}

	$paused_extensions[ $this->type ][ $extension ] = $error;

	return update_option( $option_name, $paused_extensions );
}