Make WordPress Core

Ticket #3976: general_template_php.patch

File general_template_php.patch, 2.4 KB (added by harkos, 18 years ago)

Changes to wp_get_archives()

  • general-template.php

     
    364364                                $text = sprintf(__('%1$s %2$d'), $wp_locale->get_month($arcresult->month), $arcresult->year);
    365365                                if ( $show_post_count )
    366366                                        $after = ' ('.$arcresult->posts.')' . $afterafter;
     367            // Allows language plugins to manipulate the presented text
     368            $text = apply_filters('wp_get_archives', $text,
     369               array('year' => $arcresult->year, 'month' => $arcresult->month), $type);
    367370                                echo get_archives_link($url, $text, $format, $before, $after);
    368371                        }
    369372                }
     
    376379                                $text = sprintf('%d', $arcresult->year);
    377380                                if ($show_post_count)
    378381                                        $after = ' ('.$arcresult->posts.')' . $afterafter;
     382            // Allows language plugins to manipulate the presented text
     383            $text = apply_filters('wp_get_archives', $text,
     384               array('year' => $arcresult->year), $type);
    379385                                echo get_archives_link($url, $text, $format, $before, $after);
    380386                        }
    381387                }
     
    389395                                $text = mysql2date($archive_day_date_format, $date);
    390396                                if ($show_post_count)
    391397                                        $after = ' ('.$arcresult->posts.')'.$afterafter;
     398            // Allows language plugins to manipulate the presented text
     399            $text = apply_filters('wp_get_archives', $text,
     400               array('year' => $arcresult->year, 'month' => $arcresult->month,
     401               'day' => $arcresult->dayofmonth), $type);
    392402                                echo get_archives_link($url, $text, $format, $before, $after);
    393403                        }
    394404                }
     
    409419                                                $text = $arc_week_start . $archive_week_separator . $arc_week_end;
    410420                                                if ($show_post_count)
    411421                                                        $after = ' ('.$arcresult->posts.')'.$afterafter;
     422                  // Allows language plugins to manipulate the presented text
     423                  $text = apply_filters('wp_get_archives', $text,
     424                     array('year' => $arcresult->yr, 'week'=>$arcresult->week), $type);
    412425                                                echo get_archives_link($url, $text, $format, $before, $after);
    413426                                        }
    414427                                }
     
    425438                                                $text = strip_tags($arc_title);
    426439                                        else
    427440                                                $text = $arcresult->ID;
     441               // Allows language plugins to manipulate the presented text
     442               $text = apply_filters('wp_get_archives', $text, array(), $type);
    428443                                        echo get_archives_link($url, $text, $format, $before, $after);
    429444                                }
    430445                        }