You can use strtoupper php function and hook to get_comment_excerpt
probably to filter comment text there. Something like this should work I think:
add_filter( 'get_comment_excerpt', 'capitalize_comments' );
function capitalize_comments( $excerpt ) {
return strtoupper( $excerpt );
}
I’m not sure what hook you can use in “User Submitted Posts” plugin – you’ll need to check code they have in templates.
Thanks
]]>I strongly recommend NOT do convert comments and user posts to uppercase. It has a direct impact on the readability and therefore an impact of SEO in second place.
I’m also keen why you didn’t want to format the text via CSS. In case you don’t like the uppercase comments after a while you can simply adjust your CSS code. Converting all comments to real uppercase means there’s no way back on a later point in time.
Anyway, you’re here for a solution, not a preach, right? Feel free to knock yourself out by adding the following code snippet to your functions.php:
add_action('wp_insert_comment', 'comment_to_uppercase', 99, 2);
function comment_to_uppercase($id, $object) {
$data = (array) $object;
$data['comment_content'] = strtoupper($object->comment_content);
wp_update_comment($data);
}
Please note that this snippet on only affects the comments, not the user posts.
Have fund with the snippet and have a great weekend!
Niels
]]>