[wp-trac] [WordPress Trac] #9026: widget call to wp_get_archives:
type=monthly hardwired
WordPress Trac
wp-trac at lists.automattic.com
Tue Feb 3 04:58:03 GMT 2009
#9026: widget call to wp_get_archives: type=monthly hardwired
--------------------------+-------------------------------------------------
Reporter: jidanni | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 2.8
Component: Widgets | Version: 2.7
Severity: normal | Keywords:
--------------------------+-------------------------------------------------
In widgets.php, type=monthly is hardwired with no way to change it:
{{{
wp_get_archives("type=monthly&format=option&show_post_count=$c");
}}}
Quite a shame. Needs massive workaround just to get year instead: e.g., a
my-plugin.php:
{{{
function widget_myuniquewidget_register() {
function j_widget_yearly_archives($args) {
extract($args);
echo $before_widget; echo $before_title .'Archives'. $after_title;
?><ul><?php wp_get_archives("type=yearly&show_post_count=1");
?></ul><?php
echo $after_widget;}
register_sidebar_widget('J yearly archives
workaround','j_widget_yearly_archives');}
add_action('init', widget_myuniquewidget_register);
}}}
(hardwired too, else the user needs to make an even longer plugin.)
--
Ticket URL: <http://trac.wordpress.org/ticket/9026>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list