Yoast_Input_Validation::get_error_description()public staticYoast 12.1

Gets a specific error description.

Метод класса: Yoast_Input_Validation{}

Хуков нет.

Возвращает

Строку|null. The error description.

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

$result = Yoast_Input_Validation::get_error_description( $error_code );
$error_code(строка) (обязательный)
Code of the error set via add_settings_error(), normally the variable name.

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

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

Код Yoast_Input_Validation::get_error_description() Yoast 22.4

public static function get_error_description( $error_code ) {
	if ( ! isset( self::$error_descriptions[ $error_code ] ) ) {
		return null;
	}

	return self::$error_descriptions[ $error_code ];
}