diff --git a/CHANGELOG.md b/CHANGELOG.md index 811af81..5213132 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ ### HEAD +* Remove additional widget classes * Move `/assets/css/less/` to `/assets/less/` * Add wrapper templates filter * Fix relative external URLs issue diff --git a/lib/cleanup.php b/lib/cleanup.php index 4555077..f25c573 100644 --- a/lib/cleanup.php +++ b/lib/cleanup.php @@ -395,45 +395,6 @@ function roots_change_mce_options($options) { } add_filter('tiny_mce_before_init', 'roots_change_mce_options'); -/** - * Add additional classes onto widgets - * - * @link http://wordpress.org/support/topic/how-to-first-and-last-css-classes-for-sidebar-widgets - */ -function roots_widget_first_last_classes($params) { - global $my_widget_num; - - $this_id = $params[0]['id']; - $arr_registered_widgets = wp_get_sidebars_widgets(); - - if (!$my_widget_num) { - $my_widget_num = array(); - } - - if (!isset($arr_registered_widgets[$this_id]) || !is_array($arr_registered_widgets[$this_id])) { - return $params; - } - - if (isset($my_widget_num[$this_id])) { - $my_widget_num[$this_id] ++; - } else { - $my_widget_num[$this_id] = 1; - } - - $class = 'class="widget-' . $my_widget_num[$this_id] . ' '; - - if ($my_widget_num[$this_id] == 1) { - $class .= 'widget-first '; - } elseif ($my_widget_num[$this_id] == count($arr_registered_widgets[$this_id])) { - $class .= 'widget-last '; - } - - $params[0]['before_widget'] = preg_replace('/class=\"/', "$class", $params[0]['before_widget'], 1); - - return $params; -} -add_filter('dynamic_sidebar_params', 'roots_widget_first_last_classes'); - /** * Redirects search results from /?s=query to /search/query/, converts %20 to + *