wp_json_schema_allowed_keywords │ хук-фильтр │ WP 7.1.0

Filters the JSON Schema keywords allowed for a given schema profile.

Use this to decide which keywords may be exposed to clients for a profile. It does not make WordPress validate or sanitize values against the keyword.

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

add_filter( 'wp_json_schema_allowed_keywords', 'wp_kama_json_schema_allowed_keywords_filter', 10, 2 );

/**
 * Function for `wp_json_schema_allowed_keywords` filter-hook.
 * 
 * @param string[] $allowed_keywords Allowed JSON Schema keywords.
 * @param string   $schema_profile   The schema profile the keywords are for.
 *
 * @return string[]
 */
function wp_kama_json_schema_allowed_keywords_filter( $allowed_keywords, $schema_profile ){
	// filter...
	return $allowed_keywords;
}
$allowed_keywords(string[])
Allowed JSON Schema keywords.
$schema_profile(строка)
The schema profile the keywords are for.

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

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

Где вызывается хук

wp_get_json_schema_allowed_keywords()
wp_json_schema_allowed_keywords
wp-includes/json-schema.php 68
return apply_filters( 'wp_json_schema_allowed_keywords', $allowed_keywords, $schema_profile );

Где используется хук в WordPress

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