#14322 closed enhancement (worksforme)
Easier configuration/modification of Recent Posts widget
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Widgets | Version: | 3.0 |
| Severity: | minor | Keywords: | |
| Cc: | bondra.4@… |
Description
As far as I can tell from scrounging through the documentation, there are no filters/actions/etc. for modifying the output of the Recent Posts Widget.
It seems silly that I should have to recreate this widget simply to change how it outputs the recent posts (for instance simply to add a "by [author]" after the link to the post).
Since this widget is so commonly used in Wordpress, why not give themers and coders ways to get in and tweak it a bit instead of essentially having to rebuild it again from the ground up?
This is just a thought, and thanks in advance for taking the time to consider it.
Change History (4)
- Severity changed from normal to minor
- Type changed from feature request to enhancement
Ah-ha! So you can extend that class. I was digging through the Codex and forums and Googling like mad and I couldn't figure out what the class name of that widget was.
Thanks!
Although I still think a filter might make this a bit easier on themers. If this widget is part of core, it just seems like it being able to customize it a bit more easily would be great. It's such a commonly used thing.
- Milestone Awaiting Review deleted
- Resolution set to worksforme
- Status changed from new to closed
All widget classes are found in wp-includes/default-widgets.php
Closing as worksforme. Feel free to reopen with a working patch.

You don't have to rebuild the entire widget, just the method that does the outputing:
Class My_Recent_Posts_Widget extends WP_Widget_Recent_Posts { function widget($args, $instance) { // custom code here } }