WordPress.org

Make WordPress Core

Ticket #16610: 16610.diff

File 16610.diff, 1.1 KB (added by nacin, 7 years ago)

Untested and unconvinced.

  • wp-content/themes/twentyten/functions.php

     
    303303function twentyten_remove_gallery_css( $css ) {
    304304        return preg_replace( "#<style type='text/css'>(.*?)</style>#s", '', $css );
    305305}
     306// Backwards compatibility with WordPress 3.0.
     307if ( version_compare( $GLOBALS['wp_version'], '3.1', '<' ) )
     308        add_filter( 'gallery_style', 'twentyten_remove_gallery_css' );
    306309
    307310if ( ! function_exists( 'twentyten_comment' ) ) :
    308311/**
     
    447450 */
    448451function twentyten_remove_recent_comments_style() {
    449452        add_filter( 'show_recent_comments_widget_style', '__return_false' );
     453
     454        // Backwards compatibility with WordPress 3.0.
     455        if ( version_compare( $GLOBALS['wp_version'], '3.1', '<' ) ) {
     456                global $wp_widget_factory;
     457                remove_action( 'wp_head', array( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style' ) );
     458        }
    450459}
    451460add_action( 'widgets_init', 'twentyten_remove_recent_comments_style' );
    452461