Skip to:
Content

BuddyPress.org

Ticket #7809: 7809.02.patch

File 7809.02.patch, 1.5 KB (added by r-a-y, 7 years ago)
  • src/bp-messages/bp-messages-star.php

     
    364364        return $retval;
    365365}
    366366add_filter( 'bp_get_the_thread_message_css_class', 'bp_messages_star_message_css_class' );
     367
     368/**
     369 * Filter message threads by those starred by the logged-in user.
     370 *
     371 * @since 2.3.0
     372 *
     373 * @param  array $r Current message thread arguments.
     374 * @return array $r Array of starred message threads.
     375 */
     376function bp_messages_filter_starred_message_threads( $r = array() ) {
     377        $r['box'] = 'starred';
     378        $r['meta_query'] = array( array(
     379                'key'   => 'starred_by_user',
     380                'value' => $r['user_id']
     381        ) );
     382
     383        return $r;
     384}
  • src/bp-messages/screens/starred.php

     
    4040        // Remove our filter.
    4141        remove_filter( 'bp_after_has_message_threads_parse_args', 'bp_messages_filter_starred_message_threads' );
    4242}
    43 
    44 /**
    45  * Filter message threads by those starred by the logged-in user.
    46  *
    47  * @since 2.3.0
    48  *
    49  * @param  array $r Current message thread arguments.
    50  * @return array $r Array of starred message threads.
    51  */
    52 function bp_messages_filter_starred_message_threads( $r = array() ) {
    53         $r['box'] = 'starred';
    54         $r['meta_query'] = array( array(
    55                 'key'   => 'starred_by_user',
    56                 'value' => $r['user_id']
    57         ) );
    58 
    59         return $r;
    60 }
    61  No newline at end of file