You are here

function styleswitcher_update_7205 in Style Switcher 7.2

Filter out styles: delete theme's ones - they will be loaded alive.

File

./styleswitcher.install, line 154
Installation tasks.

Code

function styleswitcher_update_7205() {
  if ($styles = variable_get('styleswitcher_styles')) {
    $custom = array();
    foreach ($styles as $key => $style) {
      if (strpos($key, 'custom/') === 0) {
        $custom[$key] = $style;
      }
    }
    variable_set('styleswitcher_custom_styles', $custom);
  }

  // A var can be null but still may use a row in DB so delete it outside of the
  // above checking.
  variable_del('styleswitcher_styles');
}