Skip to:
Content

bbPress.org

Ticket #2945: 2945.diff

File 2945.diff, 1.3 KB (added by netweb, 4 years ago)
  • src/includes/admin/tools.php

     
    21952195 * Handle the processing and feedback of the admin tools page
    21962196 *
    21972197 * @since 2.0.0 bbPress (r2613)
     2198 * @since 2.x.x bbPress (rXXXX) Post revision deletion support added
    21982199 *
    21992200 * @uses check_admin_referer() To verify the nonce and the referer
    22002201 * @uses wp_cache_flush() To flush the cache
     
    22542255                $messages[] = sprintf( $statement, $result );
    22552256        }
    22562257
     2258        /** Post Revisions ********************************************************/
     2259
     2260        if ( ! empty( $sql_posts ) ) {
     2261                $sql_meta = array();
     2262                foreach ( $sql_posts as $key => $value ) {
     2263                        $sql_meta[] = $key;
     2264                }
     2265                $statement  = __( 'Deleting Post Revisions… %s', 'bbpress' );
     2266                $sql_meta   = implode( "', '", $sql_meta );
     2267                $sql_delete = "DELETE FROM `{$bbp_db->posts}` WHERE `post_parent` IN ('{$sql_meta}');";
     2268                $result     = is_wp_error( $bbp_db->query( $sql_delete ) ) ? $failed : $success;
     2269                $messages[] = sprintf( $statement, $result );
     2270        }
     2271
    22572272        /** Forum moderators ******************************************************/
    22582273
    22592274        $statement  = __( 'Deleting Forum Moderators… %s', 'bbpress' );