Plugin Directory

Changeset 1056896


Ignore:
Timestamp:
12/30/2014 01:53:44 PM (11 years ago)
Author:
naveenann
Message:

Clean up the options when the plugin is deactivated

File:
1 edited

Legend:

Unmodified
Added
Removed
  • opensearchserver-search/trunk/index.php

    r1056834 r1056896  
    145145  delete_option('oss_display_type');
    146146  delete_option('oss_display_date');
    147   delete_option('oss_index_types_post');
    148   delete_option('oss_index_types_page');
    149   delete_option('oss_index_types_attachment');
    150   delete_option('oss_index_types_revision');
    151   delete_option('oss_index_types_nav_menu_item');
    152147  delete_option('oss_index_from');
    153148  delete_option('oss_index_to');
     
    160155  delete_option('oss_display_category');
    161156  delete_option('oss_enable_autoindexation');
     157  delete_option('oss_custom_field');
     158  delete_option('oss_facet_behavior');
     159  delete_option('oss_taxonomy_display');
     160 
    162161  $taxonomies=get_taxonomies('','names');
    163162    foreach ($taxonomies as $taxonomy ) {
     
    169168      $check_custom_field_label = 'oss_custom_field_'.strtolower(str_replace(' ', '_', $custom_field_label));
    170169      delete_option($check_custom_field_label);
     170  }
     171//Delete all the options starts with oss_index_types.
     172  $all_options = wp_load_alloptions();
     173  foreach( $all_options as $name => $value ) {
     174    if(strrpos($name, 'oss_index_types', - strlen($name)) !== FALSE) {
     175        delete_option($name);
     176    }
    171177  }
    172178}
Note: See TracChangeset for help on using the changeset viewer.