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