Make WordPress Core

Opened 15 years ago

Closed 14 years ago

#9026 closed defect (bug) (duplicate)

widget call to wp_get_archives: type=monthly hardwired

Reported by: jidanni's profile jidanni Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.7
Component: Widgets Keywords: needs-patch
Focuses: Cc:


In widgets.php, type=monthly is hardwired with no way to change it:


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) {
    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.)

Change History (4)

#1 @jidanni
15 years ago

  • Cc jidanni@… added

#2 @Denis-de-Bernardy
14 years ago

  • Keywords needs-patch added

#3 @Denis-de-Bernardy
14 years ago

  • Milestone changed from 2.8 to Future Release

#4 @Denis-de-Bernardy
14 years ago

  • Milestone Future Release deleted
  • Resolution set to duplicate
  • Status changed from new to closed

See #9780

Note: See TracTickets for help on using tickets.