wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi



rest_validate_json_schema_pattern › WordPress Function

Da5.6.0
Deprecaton/a
rest_validate_json_schema_pattern ( $pattern, $value )
Parametri: (2)
  • (string) $pattern The pattern to match against.
    Richiesto:
  • (string) $value The value to check.
    Richiesto:
Ritorna:
  • (bool) True if the pattern matches the given value, false otherwise.
Definito a:
Codex:

Validates if the JSON Schema pattern matches a value.



Sorgenti

function rest_validate_json_schema_pattern( $pattern, $value ) {
	$escaped_pattern = str_replace( '#', '\\#', $pattern );

	return 1 === preg_match( '#' . $escaped_pattern . '#u', $value );
}