I am attempting to take away the unsightly embedded <STYLE> tag the built-in Recent Comments widget puts during my <HEAD>, however i can't appear to obtain the syntax right. It initially calls

add_action( 'wp_head', array(&$this, 'recent_comments_style') );

to include it (in wp-includes/default-widgets.php, line 609), and I am attempting to undo it.

It ought to be something similar to this:

remove_action('wp_head', 'WP_Widget_Recent_Comments::recent_comments_style');

but with the versions I have attempted I still can't understand it properly. Does anybody understand how to accomplish this?

Possibly Useful:

This is actually the correct code:


However, it does not work due to this bug.

add_action('wp_head', 'remove_widget_action', 1);
function remove_widget_action() {
    global $wp_widget_factory;

    remove_action( 'wp_head', array($wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style') );

This will work because Wordpress uses exactly the same functions to produce the initial IDs whether you remove or add it.

remove_action('wp_head', array(&$this, 'recent_comments_style'));

examined. works