Plugin Directory

Changeset 1160354


Ignore:
Timestamp:
05/14/2015 11:35:54 AM (11 years ago)
Author:
doddo
Message:

added some clean up stuff when deactivating the plugin

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-stardate/trunk/stardate.php

    r1159122 r1160354  
    329329     *
    330330     */
     331   
     332    if ( ! is_admin() )
     333    {
     334        return;
     335    }
     336   
    331337    delete_option('stardate_prefix');
    332338    delete_option('stardate_style');
     
    336342   
    337343    unstardate_all_posts();
     344   
     345    $terms = get_terms( 'stardate', array( 'fields' => 'ids', 'hide_empty' => false ) );
     346    foreach ( $terms as $value ) {
     347        wp_delete_term( $value, 'stardate' );
     348    }
     349    /*
     350    // Remove the taxonomies from the wordpress database!!!
     351    $query = $wpdb->prepare("
     352            DELETE t.*, tt.*
     353              FROM $wpdb->terms
     354                AS t
     355        INNER JOIN $wpdb->term_taxonomy
     356                AS tt
     357                ON t.term_id = tt.term_id
     358             WHERE tt.taxonomy = 'stardate'");
     359   
     360    //$wpdb-> ${wpdb->terms}
     361    */
    338362}
    339363
Note: See TracChangeset for help on using the changeset viewer.