From d29fe04a845afd7366db291527cc58a5e5eb1c63 Mon Sep 17 00:00:00 2001 From: Ben Word Date: Sun, 15 Jul 2012 02:15:58 -0500 Subject: [PATCH] Remove unncessary roots_gallery_style() roots_gallery_style() is no longer needed. The new filter on use_default_gallery_style() isn't necessary either, but if the Roots gallery replacement isn't used then it will remove the additional CSS added by WordPress galleries. --- inc/cleanup.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/inc/cleanup.php b/inc/cleanup.php index dacdec2..00a2e6c 100644 --- a/inc/cleanup.php +++ b/inc/cleanup.php @@ -181,7 +181,7 @@ function roots_head_cleanup() { remove_action('wp_head', 'wp_shortlink_wp_head', 10, 0); add_action('wp_head', 'roots_remove_recent_comments_style', 1); - add_filter('gallery_style', 'roots_gallery_style'); + add_filter('use_default_gallery_style', '__return_null'); if (!class_exists('WPSEO_Frontend')) { remove_action('wp_head', 'rel_canonical'); @@ -212,10 +212,6 @@ function roots_remove_recent_comments_style() { } } -function roots_gallery_style($css) { - return preg_replace("!!s", '', $css); -} - add_action('init', 'roots_head_cleanup'); /** @@ -225,7 +221,7 @@ add_action('init', 'roots_head_cleanup'); * * @link http://twitter.github.com/bootstrap/components.html#thumbnails */ -function roots_gallery_shortcode($attr) { +function roots_gallery($attr) { global $post, $wp_locale; static $instance = 0; @@ -330,7 +326,7 @@ function roots_gallery_shortcode($attr) { } remove_shortcode('gallery'); -add_shortcode('gallery', 'roots_gallery_shortcode'); +add_shortcode('gallery', 'roots_gallery'); /** * Add class="thumbnail" to attachment items