Make WordPress Core

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#10612 closed enhancement (wontfix)

Extract recent comments code out of the widget

Reported by: viper007bond's profile Viper007Bond Owned by:
Milestone: Priority: normal
Severity: minor Version: 2.9
Component: Template Keywords: needs-patch
Focuses: Cc:

Description

For those of us who don't use a widgetized sidebar, there's no easy way to display recent comments without copy/pasting the widget's code or using a plugin.

The code used in the widget should be extracted into function(s) that can be used outside of the widget.

Change History (5)

#1 follow-up: @azaozz
15 years ago

Perhaps have a look at the_widget($widget, $instance = array(), $args = array()). It would output an instance of a widget. For recent comments it would be the_widget( 'WP_Widget_Recent_Comments' );.

#2 @westi
15 years ago

Relates to #10615

#3 in reply to: ↑ 1 @Viper007Bond
15 years ago

Replying to azaozz:

Perhaps have a look at the_widget($widget, $instance = array(), $args = array()). It would output an instance of a widget. For recent comments it would be the_widget( 'WP_Widget_Recent_Comments' );.

I had briefly thought about trying to get the widget run on it's own, but then I thought it wouldn't work due to settings, etc.

Good to know (I ended up using a plugin). Thanks!

#4 @azaozz
15 years ago

  • Resolution set to wontfix
  • Status changed from new to closed

It works pretty well, the settings can be hard-coded or use some code to change them depending on template, etc.

#5 @Denis-de-Bernardy
15 years ago

  • Milestone Unassigned deleted
Note: See TracTickets for help on using tickets.