We want to automatically mark a few messages as read based on their subject so that they do not show up in the unread_count number of messages.
I have come up with this but I am not sure if I am even on the right path.
function markcommentreadplease(){
if ($message->subject == "comment on your post") { ?>
<script type="text/javascript">
jQuery($messages_new_message).removeClass("unread").addClass("read");
</script><?php }}
Or
function markcommentreadplease(){
if ($message->subject == "comment on your post") { ?>
<script type="text/javascript">
jQuery(this).removeClass("unread").addClass("read");
</script><?php }}
add_action( 'messages_new_message', 'markcommentreadplease' );
Any ideas?
Thanks in advance.