Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/13/2012 05:46:52 AM (13 years ago)
Author:
johnjamesjacoby
Message:

Clean up $bp->current_component, $bp->current_action, and $bp->current_item usage. Fixes #3738.

File:
1 edited

Legend:

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

    r5729 r5758  
    128128        $this->thread = $this->next_thread();
    129129
    130         if ( 'notices' != $bp->current_action ) {
     130        if ( ! bp_is_current_action( 'notices' ) ) {
    131131            $last_message_index = count( $this->thread->messages ) - 1;
    132132            $this->thread->messages = array_reverse( (array) $this->thread->messages );
     
    168168
    169169    $defaults = array(
    170         'user_id' => bp_loggedin_user_id(),
    171         'box' => 'inbox',
     170        'user_id'  => bp_loggedin_user_id(),
     171        'box'      => 'inbox',
    172172        'per_page' => 10,
    173         'max' => false,
    174         'type' => 'all'
     173        'max'      => false,
     174        'type'     => 'all'
    175175    );
    176176
     
    178178    extract( $r, EXTR_SKIP );
    179179
    180     if ( 'notices' == $bp->current_action && !bp_current_user_can( 'bp_moderate' ) ) {
     180    if ( bp_is_current_action( 'notices' ) && !bp_current_user_can( 'bp_moderate' ) ) {
    181181        wp_redirect( bp_displayed_user_id() );
    182182    } else {
    183         if ( 'inbox' == $bp->current_action )
     183        if ( bp_is_current_action( 'inbox' ) ) {
    184184            bp_core_delete_notifications_by_type( bp_loggedin_user_id(), $bp->messages->id, 'new_message' );
    185 
    186         if ( 'sentbox' == $bp->current_action )
     185        }
     186
     187        if ( bp_is_current_action( 'sentbox' ) )
    187188            $box = 'sentbox';
    188189
    189         if ( 'notices' == $bp->current_action )
     190        if ( bp_is_current_action( 'notices' ) )
    190191            $box = 'notices';
    191192
     
    247248    function bp_get_message_thread_to() {
    248249        global $messages_template;
    249         return apply_filters( 'bp_message_thread_to', BP_Messages_Thread::get_recipient_links($messages_template->thread->recipients) );
     250        return apply_filters( 'bp_message_thread_to', BP_Messages_Thread::get_recipient_links($messages_template->thread->recipients ) );
    250251    }
    251252
     
    263264    function bp_get_message_thread_delete_link() {
    264265        global $messages_template, $bp;
    265         return apply_filters( 'bp_get_message_thread_delete_link', wp_nonce_url( trailingslashit( bp_loggedin_user_domain() . $bp->messages->slug . '/' . $bp->current_action . '/delete/' . $messages_template->thread->thread_id ), 'messages_delete_thread' ) );
     266        return apply_filters( 'bp_get_message_thread_delete_link', wp_nonce_url( trailingslashit( bp_loggedin_user_domain() . $bp->messages->slug . '/' . bp_current_action() . '/delete/' . $messages_template->thread->thread_id ), 'messages_delete_thread' ) );
    266267    }
    267268
     
    416417    </select> &nbsp;
    417418
    418     <?php if ( $bp->current_action != 'sentbox' && $bp->current_action != 'notices' ) : ?>
     419    <?php if ( ! bp_is_current_action( 'sentbox' ) && bp_is_current_action( 'notices' ) ) : ?>
    419420
    420421        <a href="#" id="mark_as_read"><?php _e('Mark as Read', 'buddypress') ?></a> &nbsp;
     
    423424    <?php endif; ?>
    424425
    425     <a href="#" id="delete_<?php echo $bp->current_action ?>_messages"><?php _e('Delete Selected', 'buddypress') ?></a> &nbsp;
     426    <a href="#" id="delete_<?php echo bp_current_action(); ?>_messages"><?php _e( 'Delete Selected', 'buddypress' ); ?></a> &nbsp;
    426427
    427428<?php
Note: See TracChangeset for help on using the changeset viewer.