Skip to content

Commit

Permalink
Remove unncessary roots_gallery_style()
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
retlehs committed Jul 15, 2012
1 parent 9316f26 commit d29fe04
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions inc/cleanup.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -212,10 +212,6 @@ function roots_remove_recent_comments_style() {
}
}

function roots_gallery_style($css) {
return preg_replace("!<style type='text/css'>(.*?)</style>!s", '', $css);
}

add_action('init', 'roots_head_cleanup');

/**
Expand All @@ -225,7 +221,7 @@ function roots_gallery_style($css) {
*
* @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;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d29fe04

Please sign in to comment.