Changeset 9946
- Timestamp:
- 06/15/2015 09:01:31 PM (9 years ago)
- Location:
- trunk/src/bp-messages
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-messages/bp-messages-screens.php
r9862 r9946 196 196 global $notice_id; 197 197 198 if ( !bp_current_user_can( 'bp_moderate' ) ) { 199 return false; 200 } 201 202 $notice_id = (int)bp_action_variable( 1 ); 198 $notice_id = (int) bp_action_variable( 1 ); 203 199 204 200 if ( !empty( $notice_id ) && is_numeric( $notice_id ) ) { -
trunk/src/bp-messages/bp-messages-template.php
r9927 r9946 389 389 * @return bool True if there are threads to display, otherwise false. 390 390 */ 391 function bp_has_message_threads( $args = '') {391 function bp_has_message_threads( $args = array() ) { 392 392 global $messages_template; 393 393 394 394 // The default box the user is looking at 395 if ( bp_is_current_action( 'sentbox' ) ) { 396 $default_box = 'sentbox'; 397 } elseif ( bp_is_current_action( 'notices' ) ) { 398 $default_box = 'notices'; 399 } else { 400 $default_box = 'inbox'; 401 } 395 $current_action = bp_current_action(); 396 switch ( $current_action ) { 397 case 'sentbox' : 398 case 'notices' : 399 case 'inbox' : 400 $default_box = $current_action; 401 break; 402 default : 403 $default_box = 'inbox'; 404 break; 405 } 406 407 // User ID 408 // @todo displayed user for moderators that get this far? 409 $user_id = bp_loggedin_user_id(); 410 411 // Search Terms 412 $search_terms = isset( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : ''; 402 413 403 414 // Parse the arguments 404 415 $r = bp_parse_args( $args, array( 405 'user_id' => bp_loggedin_user_id(),416 'user_id' => $user_id, 406 417 'box' => $default_box, 407 418 'per_page' => 10, 408 419 'max' => false, 409 420 'type' => 'all', 410 'search_terms' => isset( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : '',421 'search_terms' => $search_terms, 411 422 'page_arg' => 'mpage', // See https://buddypress.trac.wordpress.org/ticket/3679 412 423 'meta_query' => array() 413 424 ), 'has_message_threads' ); 414 415 // If trying to access notices without capabilities, redirect to root domain416 if ( bp_is_current_action( 'notices' ) && !bp_current_user_can( 'bp_moderate' ) ) {417 bp_core_redirect( bp_displayed_user_domain() );418 }419 425 420 426 // Load the messages loop global up with messages
Note: See TracChangeset
for help on using the changeset viewer.