Changeset 3349 for branches/plugin/bbp-admin/bbp-functions.php
- Timestamp:
- 06/27/2011 10:18:38 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-admin/bbp-functions.php
r3337 r3349 271 271 $result = __( 'Failed!', 'bbpress' ); 272 272 273 $sql_delete = "DELETE FROM `{$wpdb->postmeta}` WHERE `meta_key` = '_bbp_ hidden_reply_count';";273 $sql_delete = "DELETE FROM `{$wpdb->postmeta}` WHERE `meta_key` = '_bbp_reply_count_hidden';"; 274 274 if ( is_wp_error( $wpdb->query( $sql_delete ) ) ) 275 275 return array( 1, sprintf( $statement, $result ) ); 276 276 277 $sql = "INSERT INTO `{$wpdb->postmeta}` (`post_id`, `meta_key`, `meta_value`) (SELECT `post_parent`, '_bbp_ hidden_reply_count', 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->spam_status_id ) ) . "') GROUP BY `post_parent`);";277 $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->spam_status_id ) ) . "') GROUP BY `post_parent`);"; 278 278 if ( is_wp_error( $wpdb->query( $sql ) ) ) 279 279 return array( 2, sprintf( $statement, $result ) ); … … 301 301 $result = __( 'Failed!', 'bbpress' ); 302 302 303 $sql_delete = "DELETE FROM {$wpdb->postmeta} WHERE meta_key IN ( '_bbp_ forum_topic_count', '_bbp_total_topic_count' );";303 $sql_delete = "DELETE FROM {$wpdb->postmeta} WHERE meta_key IN ( '_bbp_topic_count', '_bbp_total_topic_count' );"; 304 304 if ( is_wp_error( $wpdb->query( $sql_delete ) ) ) 305 305 return array( 1, sprintf( $statement, $result ) );
Note: See TracChangeset
for help on using the changeset viewer.