Changeset 6032
- Timestamp:
- 05/25/2016 01:23:29 AM (9 years ago)
- Location:
- trunk/src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/admin/metaboxes.php
r5951 r6032 495 495 496 496 // Only allow individual manipulation of reply forum if there is a mismatch 497 if ( ( $reply_forum_id !== $topic_forum_id ) && ( current_user_can( 'edit_others_replies' ) || current_user_can( 'moderate' ) ) ) : ?>497 if ( ( $reply_forum_id !== $topic_forum_id ) && ( current_user_can( 'edit_others_replies' ) || current_user_can( 'moderate', $post_id ) ) ) : ?> 498 498 499 499 <p> -
trunk/src/includes/admin/replies.php
r5951 r6032 716 716 // Alert capable users of reply forum mismatch 717 717 if ( $reply_forum_id !== $topic_forum_id ) { 718 if ( current_user_can( 'edit_others_replies' ) || current_user_can( 'moderate' ) ) {718 if ( current_user_can( 'edit_others_replies' ) || current_user_can( 'moderate', $reply_id ) ) { 719 719 $forum_title .= '<div class="attention">' . esc_html__( '(Mismatch)', 'bbpress' ) . '</div>'; 720 720 } … … 851 851 } 852 852 853 // Add Empty Spam button853 // Add "Empty Spam" button for moderators 854 854 if ( ! empty( $_GET['post_status'] ) && ( bbp_get_spam_status_id() === $_GET['post_status'] ) && current_user_can( 'moderate' ) ) { 855 855 wp_nonce_field( 'bulk-destroy', '_destroy_nonce' ); 856 $title = esc_attr__( 'Empty Spam', 'bbpress' ); 857 submit_button( $title, 'button-secondary apply', 'delete_all', false ); 856 submit_button( 857 esc_attr__( 'Empty Spam', 'bbpress' ), 858 'button-secondary apply', 859 'delete_all', 860 false 861 ); 858 862 } 859 863 860 864 // Get which forum is selected 861 $selected = ! empty( $_GET['bbp_forum_id'] ) ? $_GET['bbp_forum_id'] : ''; 865 $selected = ! empty( $_GET['bbp_forum_id'] ) 866 ? (int) $_GET['bbp_forum_id'] 867 : 0; 862 868 863 869 // Show the forums dropdown -
trunk/src/includes/admin/topics.php
r5951 r6032 1004 1004 } 1005 1005 1006 // Add Empty Spam button1006 // Add "Empty Spam" button for moderators 1007 1007 if ( ! empty( $_GET['post_status'] ) && ( bbp_get_spam_status_id() === $_GET['post_status'] ) && current_user_can( 'moderate' ) ) { 1008 1008 wp_nonce_field( 'bulk-destroy', '_destroy_nonce' ); 1009 $title = esc_attr__( 'Empty Spam', 'bbpress' ); 1010 submit_button( $title, 'button-secondary apply', 'delete_all', false ); 1009 submit_button( 1010 esc_attr__( 'Empty Spam', 'bbpress' ), 1011 'button-secondary apply', 1012 'delete_all', 1013 false 1014 ); 1011 1015 } 1012 1016 1013 1017 // Get which forum is selected 1014 $selected = ! empty( $_GET['bbp_forum_id'] ) ? $_GET['bbp_forum_id'] : ''; 1018 $selected = ! empty( $_GET['bbp_forum_id'] ) 1019 ? (int) $_GET['bbp_forum_id'] 1020 : 0; 1015 1021 1016 1022 // Show the forums dropdown -
trunk/src/includes/forums/functions.php
r6026 r6032 339 339 340 340 // User can moderate, so redirect to forum with view all set 341 if ( current_user_can( 'moderate' ) ) {341 if ( current_user_can( 'moderate', $forum_id ) ) { 342 342 $redirect_url = bbp_add_view_all( $redirect_url ); 343 343 -
trunk/src/includes/replies/functions.php
r6026 r6032 319 319 320 320 // If topic is closed, moderators can still reply 321 if ( bbp_is_topic_closed( $topic_id ) && ! current_user_can( 'moderate' ) ) {321 if ( bbp_is_topic_closed( $topic_id ) && ! current_user_can( 'moderate', $topic_id ) ) { 322 322 bbp_add_error( 'bbp_reply_topic_closed', __( '<strong>ERROR</strong>: Topic is closed.', 'bbpress' ) ); 323 323 } -
trunk/src/includes/topics/functions.php
r6027 r6032 389 389 390 390 // What's the caps? 391 if ( current_user_can( 'moderate' ) ) {391 if ( current_user_can( 'moderate', $topic_id ) ) { 392 392 393 393 // What's the haps? … … 428 428 429 429 // User can moderate, so redirect to topic with view all set 430 if ( current_user_can( 'moderate' ) ) {430 if ( current_user_can( 'moderate', $topic_id ) ) { 431 431 $redirect_url = bbp_add_view_all( $redirect_url ); 432 432 … … 760 760 761 761 // What's the caps? 762 if ( current_user_can( 'moderate' ) ) {762 if ( current_user_can( 'moderate', $topic_id ) ) { 763 763 764 764 // What's the haps? -
trunk/src/includes/users/template.php
r5951 r6032 553 553 */ 554 554 function bbp_get_admin_link( $args = array() ) { 555 556 // Bail if user cannot globally moderate 555 557 if ( ! current_user_can( 'moderate' ) ) { 556 558 return; -
trunk/src/templates/default/bbpress/form-reply.php
r5829 r6032 109 109 <?php if ( bbp_is_reply_edit() ) : ?> 110 110 111 <?php if ( current_user_can( 'moderate' ) ) : ?>111 <?php if ( current_user_can( 'moderate', bbp_get_reply_id() ) ) : ?> 112 112 113 113 <?php do_action( 'bbp_theme_before_reply_form_reply_to' ); ?> -
trunk/src/templates/default/bbpress/form-topic.php
r5868 r6032 130 130 <?php endif; ?> 131 131 132 <?php if ( current_user_can( 'moderate' ) ) : ?>132 <?php if ( current_user_can( 'moderate', bbp_get_topic_id() ) ) : ?> 133 133 134 134 <?php do_action( 'bbp_theme_before_topic_form_type' ); ?>
Note: See TracChangeset
for help on using the changeset viewer.