-/**
- * Display and process archives widget options form.
- *
- * @since 2.2.0
- */
-function wp_widget_archives_control() {
- $options = $newoptions = get_option('widget_archives');
- if ( isset($_POST["archives-submit"]) ) {
- $newoptions['count'] = isset($_POST['archives-count']);
- $newoptions['dropdown'] = isset($_POST['archives-dropdown']);
- $newoptions['title'] = strip_tags(stripslashes($_POST["archives-title"]));
- }
- if ( $options != $newoptions ) {
- $options = $newoptions;
- update_option('widget_archives', $options);
- }
- $count = $options['count'] ? 'checked="checked"' : '';
- $dropdown = $options['dropdown'] ? 'checked="checked"' : '';
- $title = attribute_escape($options['title']);
-?>
- <p><label for="archives-title"><?php _e('Title:'); ?> <input class="widefat" id="archives-title" name="archives-title" type="text" value="<?php echo $title; ?>" /></label></p>
- <p>
- <label for="archives-count"><input class="checkbox" type="checkbox" <?php echo $count; ?> id="archives-count" name="archives-count" /> <?php _e('Show post counts'); ?></label>
- <br />
- <label for="archives-dropdown"><input class="checkbox" type="checkbox" <?php echo $dropdown; ?> id="archives-dropdown" name="archives-dropdown" /> <?php _e('Display as a drop down'); ?></label>
- </p>
- <input type="hidden" id="archives-submit" name="archives-submit" value="1" />
-<?php
-}
-
-/**
- * Display meta widget.
- *
- * Displays log in/out, RSS feed links, etc.
- *
- * @since 2.2.0
- *
- * @param array $args Widget arguments.
- */
-function wp_widget_meta($args) {
- extract($args);
- $options = get_option('widget_meta');
- $title = empty($options['title']) ? __('Meta') : apply_filters('widget_title', $options['title']);
-?>
- <?php echo $before_widget; ?>
- <?php echo $before_title . $title . $after_title; ?>
- <ul>
- <?php wp_register(); ?>
- <li><?php wp_loginout(); ?></li>
- <li><a href="<?php bloginfo('rss2_url'); ?>" title="<?php echo attribute_escape(__('Syndicate this site using RSS 2.0')); ?>"><?php _e('Entries <abbr title="Really Simple Syndication">RSS</abbr>'); ?></a></li>
- <li><a href="<?php bloginfo('comments_rss2_url'); ?>" title="<?php echo attribute_escape(__('The latest comments to all posts in RSS')); ?>"><?php _e('Comments <abbr title="Really Simple Syndication">RSS</abbr>'); ?></a></li>
- <li><a href="http://wordpress.org/" title="<?php echo attribute_escape(__('Powered by WordPress, state-of-the-art semantic personal publishing platform.')); ?>">WordPress.org</a></li>
- <?php wp_meta(); ?>
- </ul>
- <?php echo $after_widget; ?>
-<?php
-}
-
-/**
- * Display and process meta widget options form.
- *
- * @since 2.2.0
- */
-function wp_widget_meta_control() {
- $options = $newoptions = get_option('widget_meta');
- if ( isset($_POST["meta-submit"]) ) {
- $newoptions['title'] = strip_tags(stripslashes($_POST["meta-title"]));
- }
- if ( $options != $newoptions ) {
- $options = $newoptions;
- update_option('widget_meta', $options);
- }
- $title = attribute_escape($options['title']);
-?>
- <p><label for="meta-title"><?php _e('Title:'); ?> <input class="widefat" id="meta-title" name="meta-title" type="text" value="<?php echo $title; ?>" /></label></p>
- <input type="hidden" id="meta-submit" name="meta-submit" value="1" />
-<?php
-}
-
-/**
- * Display calendar widget.
- *
- * @since 2.2.0
- *
- * @param array $args Widget arguments.
- */
-function wp_widget_calendar($args) {
- extract($args);
- $options = get_option('widget_calendar');
- $title = apply_filters('widget_title', $options['title']);
- if ( empty($title) )
- $title = ' ';
- echo $before_widget . $before_title . $title . $after_title;
- echo '<div id="calendar_wrap">';
- get_calendar();
- echo '</div>';
- echo $after_widget;
-}
-
-/**
- * Display and process calendar widget options form.
- *
- * @since 2.2.0
- */
-function wp_widget_calendar_control() {
- $options = $newoptions = get_option('widget_calendar');
- if ( isset($_POST["calendar-submit"]) ) {
- $newoptions['title'] = strip_tags(stripslashes($_POST["calendar-title"]));
- }
- if ( $options != $newoptions ) {
- $options = $newoptions;
- update_option('widget_calendar', $options);
- }
- $title = attribute_escape($options['title']);
-?>
- <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>
- <input type="hidden" id="calendar-submit" name="calendar-submit" value="1" />
-<?php
-}
-
-/**
- * Display the Text widget, depending on the widget number.
- *
- * Supports multiple text widgets and keeps track of the widget number by using
- * the $widget_args parameter. The option 'widget_text' is used to store the
- * content for the widgets. The content and title are passed through the
- * 'widget_text' and 'widget_title' filters respectively.
- *
- * @since 2.2.0
- *
- * @param array $args Widget arguments.
- * @param int $number Widget number.
- */
-function wp_widget_text($args, $widget_args = 1) {
- extract( $args, EXTR_SKIP );
- if ( is_numeric($widget_args) )
- $widget_args = array( 'number' => $widget_args );
- $widget_args = wp_parse_args( $widget_args, array( 'number' => -1 ) );
- extract( $widget_args, EXTR_SKIP );
-
- $options = get_option('widget_text');
- if ( !isset($options[$number]) )
- return;
-
- $title = apply_filters('widget_title', $options[$number]['title']);
- $text = apply_filters( 'widget_text', $options[$number]['text'] );
-?>
- <?php echo $before_widget; ?>
- <?php if ( !empty( $title ) ) { echo $before_title . $title . $after_title; } ?>
- <div class="textwidget"><?php echo $text; ?></div>
- <?php echo $after_widget; ?>
-<?php
-}
-
-/**
- * Display and process text widget options form.
- *
- * @since 2.2.0
- *
- * @param int $widget_args Widget number.
- */
-function wp_widget_text_control($widget_args) {
- global $wp_registered_widgets;
- static $updated = false;
-
- if ( is_numeric($widget_args) )
- $widget_args = array( 'number' => $widget_args );
- $widget_args = wp_parse_args( $widget_args, array( 'number' => -1 ) );
- extract( $widget_args, EXTR_SKIP );