Alternative_Heap::delete_tmp_wp_tables PHP Метод

delete_tmp_wp_tables() публичный Метод

Delete temp tables from an alternative heap namespace
public delete_tmp_wp_tables ( $alt_heap = "" )
    public function delete_tmp_wp_tables($alt_heap = "")
    {
        global $wpdb;
        $tables = self::get_tmp_wp_tables($alt_heap);
        // extra step: make sure no original wp tables are included in the $tables array
        // there is no logical way for this to ever happen, but i feel better putting this here
        $tables = array_diff($tables, self::get_wp_tables());
        // still, please back up databases, ok? :)
        foreach ($tables as $table) {
            set_time_limit(600);
            // allow up to 10 minutes for large db queries to finish
            $query = wp_sprintf("DROP TABLE IF EXISTS %s;", $table);
            $wpdb->query($query);
        }
    }