WordPress.org

Make WordPress Core

Changeset 10800


Ignore:
Timestamp:
03/17/09 02:41:28 (5 years ago)
Author:
ryan
Message:

Move calendar widget to WP_Widget. see #8441

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/default-widgets.php

    r10799 r10800  
    295295} 
    296296 
    297 /** 
    298  * Display calendar widget. 
    299  * 
    300  * @since 2.2.0 
    301  * 
    302  * @param array $args Widget arguments. 
    303  */ 
    304 function wp_widget_calendar($args) { 
    305     extract($args); 
    306     $options = get_option('widget_calendar'); 
    307     $title = apply_filters('widget_title', $options['title']); 
    308     if ( empty($title) ) 
    309         $title = ' '; 
    310     echo $before_widget . $before_title . $title . $after_title; 
    311     echo '<div id="calendar_wrap">'; 
    312     get_calendar(); 
    313     echo '</div>'; 
    314     echo $after_widget; 
    315 } 
    316  
    317 /** 
    318  * Display and process calendar widget options form. 
    319  * 
    320  * @since 2.2.0 
    321  */ 
    322 function wp_widget_calendar_control() { 
    323     $options = $newoptions = get_option('widget_calendar'); 
    324     if ( isset($_POST["calendar-submit"]) ) { 
    325         $newoptions['title'] = strip_tags(stripslashes($_POST["calendar-title"])); 
    326     } 
    327     if ( $options != $newoptions ) { 
    328         $options = $newoptions; 
    329         update_option('widget_calendar', $options); 
    330     } 
    331     $title = attribute_escape($options['title']); 
    332 ?> 
    333             <p><label for="calendar-title"><?php _e('Title:'); ?> <input class="widefat" id="calendar-title" name="calendar-title" type="text" value="<?php echo $title; ?>" /></label></p> 
    334             <input type="hidden" id="calendar-submit" name="calendar-submit" value="1" /> 
    335 <?php 
    336 } 
    337297 
    338298/** 
Note: See TracChangeset for help on using the changeset viewer.