Make WordPress Core

Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#10612 closed enhancement (wontfix)

Extract recent comments code out of the widget

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

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
17 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
17 years ago

Relates to #10615

#3 in reply to: ↑ 1 @Viper007Bond
17 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
17 years ago

  • Resolutionwontfix
  • Status newclosed

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
17 years ago

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