Skip to:
Content

BuddyPress.org

Ticket #6997: 6997-bp-messages-template.patch

File 6997-bp-messages-template.patch, 5.3 KB (added by Offereins, 9 years ago)

Filter updates for bp-messages-template.php

  • dev.php

    diff --git a/dev.php b/dev.php
    index 252dfee..8aa7cf3 100644
    a b function bp_message_thread_view_link( $thread_id = 0 ) { 
    304304                 * Filters the permalink of a particular thread.
    305305                 *
    306306                 * @since 1.0.0
     307                 * @since 2.6.0 Added the `$thread_id` parameter.
    307308                 *
    308                  * @param string $value permalink of a particular thread.
     309                 * @param string $value     Permalink of a particular thread.
     310                 * @param int    $thread_id ID of the thread.
    309311                 */
    310                 return apply_filters( 'bp_get_message_thread_view_link', trailingslashit( bp_loggedin_user_domain() . bp_get_messages_slug() . '/view/' . $thread_id ) );
     312                return apply_filters( 'bp_get_message_thread_view_link', trailingslashit( bp_loggedin_user_domain() . bp_get_messages_slug() . '/view/' . $thread_id ), $thread_id );
    311313        }
    312314
    313315/**
    function bp_message_thread_total_count( $thread_id = false ) { 
    546548                 * Filters the current thread's total message count.
    547549                 *
    548550                 * @since 2.2.0
     551                 * @since 2.6.0 Added the `$thread_id` parameter.
    549552                 *
    550                  * @param int $count Current thread total message count.
     553                 * @param int $count     Current thread total message count.
     554                 * @param int $thread_id ID of the queried thread.
    551555                 */
    552                 return apply_filters( 'bp_get_message_thread_total_count', $count );
     556                return apply_filters( 'bp_get_message_thread_total_count', $count, $thread_id );
    553557        }
    554558
    555559/**
    function bp_message_thread_avatar( $args = '' ) { 
    678682                 * Filters the avatar for the last sender in the current message thread.
    679683                 *
    680684                 * @since 1.0.0
     685                 * @since 2.6.0 Added the `$r` parameter.
    681686                 *
    682687                 * @param string $value User avatar string.
     688                 * @param array  $r     Array of parsed arguments.
    683689                 */
    684690                return apply_filters( 'bp_get_message_thread_avatar', bp_core_fetch_avatar( array(
    685691                        'item_id' => $messages_template->thread->last_sender_id,
    function bp_message_thread_avatar( $args = '' ) { 
    689695                        'class'   => $r['class'],
    690696                        'width'   => $r['width'],
    691697                        'height'  => $r['height'],
    692                 ) ) );
     698                ) ), $r );
    693699        }
    694700
    695701/**
    function bp_messages_options() { 
    922928?>
    923929
    924930        <label for="message-type-select" class="bp-screen-reader-text">
    925                 <?php _e( 'Select:', 'buddypress' ) ?>
     931                <?php _e( 'Select:', 'buddypress' ); ?>
    926932         </label>
    927933
    928934        <select name="message-type-select" id="message-type-select">
    929935                <option value=""><?php _e( 'Select', 'buddypress' ); ?></option>
    930                 <option value="read"><?php _ex('Read', 'Message dropdown filter', 'buddypress') ?></option>
    931                 <option value="unread"><?php _ex('Unread', 'Message dropdown filter', 'buddypress') ?></option>
    932                 <option value="all"><?php _ex('All', 'Message dropdown filter', 'buddypress') ?></option>
     936                <option value="read"><?php _ex( 'Read', 'Message dropdown filter', 'buddypress' ); ?></option>
     937                <option value="unread"><?php _ex( 'Unread', 'Message dropdown filter', 'buddypress' ); ?></option>
     938                <option value="all"><?php _ex( 'All', 'Message dropdown filter', 'buddypress' ); ?></option>
    933939        </select> &nbsp;
    934940
    935941        <?php if ( ! bp_is_current_action( 'sentbox' ) && ! bp_is_current_action( 'notices' ) ) : ?>
    936942
    937                 <a href="#" id="mark_as_read"><?php _ex('Mark as Read', 'Message management markup', 'buddypress') ?></a> &nbsp;
    938                 <a href="#" id="mark_as_unread"><?php _ex('Mark as Unread', 'Message management markup', 'buddypress') ?></a> &nbsp;
     943                <a href="#" id="mark_as_read"><?php _ex( 'Mark as Read', 'Message management markup', 'buddypress' ); ?></a> &nbsp;
     944                <a href="#" id="mark_as_unread"><?php _ex( 'Mark as Unread', 'Message management markup', 'buddypress' ); ?></a> &nbsp;
    939945
    940946        <?php endif; ?>
    941947
    function bp_message_activate_deactivate_text() { 
    11921198                global $messages_template;
    11931199
    11941200                if ( 1 === (int) $messages_template->thread->is_active  ) {
    1195                         $text = __('Deactivate', 'buddypress');
     1201                        $text = __( 'Deactivate', 'buddypress' );
    11961202                } else {
    1197                         $text = __('Activate', 'buddypress');
     1203                        $text = __( 'Activate', 'buddypress' );
    11981204                }
    11991205
    12001206                /**
    function bp_message_get_notices() { 
    12571263                        ?>
    12581264                        <div id="message" class="info notice" rel="n-<?php echo esc_attr( $notice->id ); ?>">
    12591265                                <p>
    1260                                         <strong><?php echo stripslashes( wp_filter_kses( $notice->subject ) ) ?></strong><br />
    1261                                         <?php echo stripslashes( wp_filter_kses( $notice->message) ) ?>
    1262                                         <a href="#" id="close-notice"><?php _e( 'Close', 'buddypress' ) ?></a>
     1266                                        <strong><?php echo stripslashes( wp_filter_kses( $notice->subject ) ); ?></strong><br />
     1267                                        <?php echo stripslashes( wp_filter_kses( $notice->message) ); ?>
     1268                                        <a href="#" id="close-notice"><?php _e( 'Close', 'buddypress' ); ?></a>
    12631269                                </p>
    12641270                        </div>
    12651271                        <?php
    function bp_the_thread_message_sender_avatar( $args = '' ) { 
    18041810                 * Filters the avatar for the current message sender.
    18051811                 *
    18061812                 * @since 1.1.0
     1813                 * @since 2.6.0 Added the `$r` parameter.
    18071814                 *
    18081815                 * @param string $value <img> tag containing the avatar value.
     1816                 * @param array  $r     Array of parsed arguments.
    18091817                 */
    18101818                return apply_filters( 'bp_get_the_thread_message_sender_avatar_thumb', bp_core_fetch_avatar( array(
    18111819                        'item_id' => $thread_template->message->sender_id,
    function bp_the_thread_message_sender_avatar( $args = '' ) { 
    18131821                        'width'   => $r['width'],
    18141822                        'height'  => $r['height'],
    18151823                        'alt'     => bp_core_get_user_displayname( $thread_template->message->sender_id )
    1816                 ) ) );
     1824                ) ), $r );
    18171825        }
    18181826
    18191827/**