WPSEO_Replacevar_Editor::validate_arguments
Validates the replacement variable editor arguments.
Метод класса: WPSEO_Replacevar_Editor{}
Хуков нет.
Возвращает
void. Ничего (null).
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->validate_arguments( $arguments );
- $arguments(массив) (обязательный)
- The arguments to validate.
Код WPSEO_Replacevar_Editor::validate_arguments() WPSEO Replacevar Editor::validate arguments Yoast 28.9
protected function validate_arguments( array $arguments ) {
$required_arguments = [
'title',
'description',
'page_type_recommended',
'page_type_specific',
'paper_style',
];
foreach ( $required_arguments as $field_name ) {
if ( ! array_key_exists( $field_name, $arguments ) ) {
throw new InvalidArgumentException(
sprintf(
/* translators: %1$s expands to the missing field name. */
__( 'Not all required fields are given. Missing field %1$s', 'wordpress-seo' ),
$field_name,
),
);
}
}
}