Tagged: mderation
Hi Michaël,
I will post a snippet later. There is a hook that allows you to do it.bpmts_form_field_validation_message
Regards
BrajeshHi Michaël,
Here is an example.
/** * Custom validation for BuddyPress moderation tools. * * @param string $err error message if any. * @param string $field field name. * @param mixed $value field value. * * @return string */ function buddydev_custom_moderation_validation( $err, $field, $value ) { // $field could be 'subject', 'message', 'category', 'name', 'email' switch ( $field ) { case 'message': // validate and if error, set to $err. if ( strlen( $value ) > 500 ) { $err = "Only 500 charaters allowed."; } break; case 'subject': // if subject is longer than 50 character. if ( strlen( $value ) > 50 ) { $err = "Subject is too long. Only 50 letters allowed."; } break; } return $err; } add_filter( 'bpmts_form_field_validation_message', 'buddydev_custom_moderation_validation', 10, 3 );
Please change the values as you please.
Regards
Brajesh
You must be logged in to reply to this topic.
This topic is: not resolved