wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.
rest_validate_integer_value_from_schema › WordPress Function
Od5.7.0
Przestarzałyn/a
› rest_validate_integer_value_from_schema ( $value, $args, $param )
| Parametry: (3) |
|
| Powrót: |
|
| Zdefiniowane na: |
|
| Codex: |
Validates an integer value based on a schema.
Źródło
function rest_validate_integer_value_from_schema( $value, $args, $param ) {
$is_valid_number = rest_validate_number_value_from_schema( $value, $args, $param );
if ( is_wp_error( $is_valid_number ) ) {
return $is_valid_number;
}
if ( ! rest_is_integer( $value ) ) {
return new WP_Error(
'rest_invalid_type',
/* translators: 1: Parameter, 2: Type name. */
sprintf( __( '%1$s is not of type %2$s.' ), $param, 'integer' ),
array( 'param' => $param )
);
}
return true;
}