Description
Validate a rating fieldWe only check for is_numeric() so that we can support half ratings ? 2013/07/23
Usage
oikr8_field_validation_rating( $value, $field, $data );Parameters
- $value
- ( string ) required – the field value
- $field
- ( string ) required – the field name
- $data
- ( array ) required – array of data about the field
Returns
voidSource
File name: oik-rating/oik-rating.phpLines:
1 to 9 of 9
function oikr8_field_validation_rating( $value, $field, $data ) { // bw_trace2(); $numeric = is_numeric( $value ); if ( !$numeric ) { $text = sprintf( __( "Invalid %s" ), $data['#title'] ); bw_issue_message( $field, "non_numeric", $text, "error" ); } return( $value ); }
Called by
Calls
Call hooks
API Letters:
