Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/29/2014 01:00:36 AM (10 years ago)
Author:
r-a-y
Message:

Messages: Reformat new message notifications.

This commit changes the single message notification link to go
directly to the message thread in question and not the message inbox.

When the message thread is viewed, new messages are marked as read.

Fixes #5479

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-messages/bp-messages-template.php

    r8070 r8202  
    307307    }
    308308
    309 function bp_message_thread_view_link() {
    310     echo bp_get_message_thread_view_link();
    311 }
    312     function bp_get_message_thread_view_link() {
    313         global $messages_template, $bp;
    314         return apply_filters( 'bp_get_message_thread_view_link', trailingslashit( bp_loggedin_user_domain() . $bp->messages->slug . '/view/' . $messages_template->thread->thread_id ) );
     309function bp_message_thread_view_link( $thread_id = 0 ) {
     310    echo bp_get_message_thread_view_link( $thread_id );
     311}
     312    function bp_get_message_thread_view_link( $thread_id = 0 ) {
     313        global $messages_template;
     314
     315        if ( empty( $messages_template ) && (int) $thread_id > 0 ) {
     316            $thread_id = (int) $thread_id;
     317        } else {
     318            $thread_id = $messages_template->thread->thread_id;
     319        }
     320
     321        return apply_filters( 'bp_get_message_thread_view_link', trailingslashit( bp_loggedin_user_domain() . buddypress()->messages->slug . '/view/' . $thread_id ) );
    315322    }
    316323
Note: See TracChangeset for help on using the changeset viewer.