Changeset 3506
- Timestamp:
- 09/11/2011 07:13:19 AM (13 years ago)
- Location:
- branches/plugin
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-admin/bbp-functions.php
r3505 r3506 280 280 return array( 1, sprintf( $statement, $result ) ); 281 281 282 $sql = "INSERT INTO `{$wpdb->postmeta}` (`post_id`, `meta_key`, `meta_value`) (SELECT `post_parent`, '_bbp_reply_count_hidden', COUNT(`post_status`) as `meta_value` FROM `{$wpdb->posts}` WHERE `post_type` = '" . bbp_get_reply_post_type() . "' AND `post_status` IN ( '" . join( "','", array( 'trash', bbp_get_spam_status_id() ) ) . "') GROUP BY `post_parent`);";282 $sql = "INSERT INTO `{$wpdb->postmeta}` (`post_id`, `meta_key`, `meta_value`) (SELECT `post_parent`, '_bbp_reply_count_hidden', COUNT(`post_status`) as `meta_value` FROM `{$wpdb->posts}` WHERE `post_type` = '" . bbp_get_reply_post_type() . "' AND `post_status` IN ( '" . join( "','", array( bbp_get_trash_status_id(), bbp_get_spam_status_id() ) ) . "') GROUP BY `post_parent`);"; 283 283 if ( is_wp_error( $wpdb->query( $sql ) ) ) 284 284 return array( 2, sprintf( $statement, $result ) ); -
branches/plugin/bbp-admin/bbp-replies.php
r3505 r3506 674 674 675 675 // User cannot view replies in trash 676 if ( ( 'trash'== $reply->post_status ) && !current_user_can( 'view_trash' ) )676 if ( ( bbp_get_trash_status_id() == $reply->post_status ) && !current_user_can( 'view_trash' ) ) 677 677 unset( $actions['view'] ); 678 678 … … 732 732 733 733 // Add Empty Spam button 734 if ( !empty( $_GET['post_status'] ) && ( 'spam'== $_GET['post_status'] ) && current_user_can( 'moderate' ) ) {734 if ( !empty( $_GET['post_status'] ) && ( bbp_get_spam_status_id() == $_GET['post_status'] ) && current_user_can( 'moderate' ) ) { 735 735 wp_nonce_field( 'bulk-destroy', '_destroy_nonce' ); 736 736 $title = esc_attr__( 'Empty Spam', 'bbpress' ); -
branches/plugin/bbp-admin/bbp-topics.php
r3505 r3506 726 726 727 727 // Show view link if it's not set, the topic is trashed and the user can view trashed topics 728 if ( empty( $actions['view'] ) && 'trash' == $topic->post_status&& current_user_can( 'view_trash' ) )728 if ( empty( $actions['view'] ) && ( bbp_get_trash_status_id() == $topic->post_status ) && current_user_can( 'view_trash' ) ) 729 729 $actions['view'] = '<a href="' . bbp_get_topic_permalink( $topic->ID ) . '" title="' . esc_attr( sprintf( __( 'View “%s”', 'bbpress' ), bbp_get_topic_title( $topic->ID ) ) ) . '" rel="permalink">' . __( 'View', 'bbpress' ) . '</a>'; 730 730 … … 807 807 808 808 // Add Empty Spam button 809 if ( !empty( $_GET['post_status'] ) && ( 'spam'== $_GET['post_status'] ) && current_user_can( 'moderate' ) ) {809 if ( !empty( $_GET['post_status'] ) && ( bbp_get_spam_status_id() == $_GET['post_status'] ) && current_user_can( 'moderate' ) ) { 810 810 wp_nonce_field( 'bulk-destroy', '_destroy_nonce' ); 811 811 $title = esc_attr__( 'Empty Spam', 'bbpress' ); -
branches/plugin/bbp-includes/bbp-reply-template.php
r3505 r3506 84 84 // What are the default allowed statuses (based on user caps) 85 85 if ( bbp_get_view_all( 'edit_others_replies' ) ) { 86 $default_status = join( ',', array( bbp_get_public_status_id(), bbp_get_closed_status_id(), bbp_get_spam_status_id(), 'trash') );86 $default_status = join( ',', array( bbp_get_public_status_id(), bbp_get_closed_status_id(), bbp_get_spam_status_id(), bbp_get_trash_status_id() ) ); 87 87 } 88 88 } … … 1380 1380 1381 1381 // Trash link shouldn't be visible on spam topics 1382 elseif ( isset( $r['links']['trash'] ) && $reply_status == bbp_get_spam_status_id() )1382 elseif ( isset( $r['links']['trash'] ) && ( bbp_get_spam_status_id() == $reply_status ) ) 1383 1383 unset( $r['links']['trash'] ); 1384 1384 } -
branches/plugin/bbp-includes/bbp-topic-functions.php
r3505 r3506 2717 2717 2718 2718 // Valid topic/reply statuses 2719 $post_stati = join( ',', array( bbp_get_public_status_id(), bbp_get_spam_status_id(), 'trash') );2719 $post_stati = join( ',', array( bbp_get_public_status_id(), bbp_get_spam_status_id(), bbp_get_trash_status_id() ) ); 2720 2720 2721 2721 // Topic is being permanently deleted, so its replies gotta go too
Note: See TracChangeset
for help on using the changeset viewer.