Add filters for default widgets calling template functions, props Denis-de-Bernardy, fixes #9780
git-svn-id: http://svn.automattic.com/wordpress/trunk@11254 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
077697d1ca
commit
d2f74d993d
|
@ -29,7 +29,7 @@ class WP_Widget_Pages extends WP_Widget {
|
||||||
if ( $sortby == 'menu_order' )
|
if ( $sortby == 'menu_order' )
|
||||||
$sortby = 'menu_order, post_title';
|
$sortby = 'menu_order, post_title';
|
||||||
|
|
||||||
$out = wp_list_pages( array('title_li' => '', 'echo' => 0, 'sort_column' => $sortby, 'exclude' => $exclude) );
|
$out = wp_list_pages( apply_filters('widget_pages_args', array('title_li' => '', 'echo' => 0, 'sort_column' => $sortby, 'exclude' => $exclude) ) );
|
||||||
|
|
||||||
if ( !empty( $out ) ) {
|
if ( !empty( $out ) ) {
|
||||||
echo $before_widget;
|
echo $before_widget;
|
||||||
|
@ -212,12 +212,12 @@ class WP_Widget_Archives extends WP_Widget {
|
||||||
|
|
||||||
if ( $d ) {
|
if ( $d ) {
|
||||||
?>
|
?>
|
||||||
<select name="archive-dropdown" onchange='document.location.href=this.options[this.selectedIndex].value;'> <option value=""><?php echo esc_attr(__('Select Month')); ?></option> <?php wp_get_archives("type=monthly&format=option&show_post_count=$c"); ?> </select>
|
<select name="archive-dropdown" onchange='document.location.href=this.options[this.selectedIndex].value;'> <option value=""><?php echo esc_attr(__('Select Month')); ?></option> <?php wp_get_archives(apply_filters('widget_archives_dropdown_args', array('type' => 'monthly', 'format' => 'option', 'show_post_count' => $c))); ?> </select>
|
||||||
<?php
|
<?php
|
||||||
} else {
|
} else {
|
||||||
?>
|
?>
|
||||||
<ul>
|
<ul>
|
||||||
<?php wp_get_archives("type=monthly&show_post_count=$c"); ?>
|
<?php wp_get_archives(apply_filters('widget_archives_args', array('type' => 'monthly', 'show_post_count' => $c))); ?>
|
||||||
</ul>
|
</ul>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
@ -426,7 +426,7 @@ class WP_Widget_Categories extends WP_Widget {
|
||||||
|
|
||||||
if ( $d ) {
|
if ( $d ) {
|
||||||
$cat_args['show_option_none'] = __('Select Category');
|
$cat_args['show_option_none'] = __('Select Category');
|
||||||
wp_dropdown_categories($cat_args);
|
wp_dropdown_categories(apply_filters('widget_categories_dropdown_args', $cat_args));
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<script type='text/javascript'>
|
<script type='text/javascript'>
|
||||||
|
@ -447,7 +447,7 @@ class WP_Widget_Categories extends WP_Widget {
|
||||||
<ul>
|
<ul>
|
||||||
<?php
|
<?php
|
||||||
$cat_args['title_li'] = '';
|
$cat_args['title_li'] = '';
|
||||||
wp_list_categories($cat_args);
|
wp_list_categories(apply_filters('widget_categories_args', $cat_args));
|
||||||
?>
|
?>
|
||||||
</ul>
|
</ul>
|
||||||
<?php
|
<?php
|
||||||
|
@ -980,7 +980,7 @@ class WP_Widget_Tag_Cloud extends WP_Widget {
|
||||||
if ( $title )
|
if ( $title )
|
||||||
echo $before_title . $title . $after_title;
|
echo $before_title . $title . $after_title;
|
||||||
echo '<div>';
|
echo '<div>';
|
||||||
wp_tag_cloud();
|
wp_tag_cloud(apply_filters('widget_tag_cloud_args', array()));
|
||||||
echo "</div>\n";
|
echo "</div>\n";
|
||||||
echo $after_widget;
|
echo $after_widget;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue