Ticket #16610: 16610.diff

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

Untested and unconvinced.

Line 
1Index: wp-content/themes/twentyten/functions.php
2===================================================================
3--- wp-content/themes/twentyten/functions.php   (revision 17469)
4+++ wp-content/themes/twentyten/functions.php   (working copy)
5@@ -303,6 +303,9 @@
6 function twentyten_remove_gallery_css( $css ) {
7        return preg_replace( "#<style type='text/css'>(.*?)</style>#s", '', $css );
8 }
9+// Backwards compatibility with WordPress 3.0.
10+if ( version_compare( $GLOBALS['wp_version'], '3.1', '<' ) )
11+       add_filter( 'gallery_style', 'twentyten_remove_gallery_css' );
12 
13 if ( ! function_exists( 'twentyten_comment' ) ) :
14 /**
15@@ -447,6 +450,12 @@
16  */
17 function twentyten_remove_recent_comments_style() {
18        add_filter( 'show_recent_comments_widget_style', '__return_false' );
19+
20+       // Backwards compatibility with WordPress 3.0.
21+       if ( version_compare( $GLOBALS['wp_version'], '3.1', '<' ) ) {
22+               global $wp_widget_factory;
23+               remove_action( 'wp_head', array( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style' ) );
24+       }
25 }
26 add_action( 'widgets_init', 'twentyten_remove_recent_comments_style' );
27