WordPress.org

Make WordPress Core

Changeset 10797


Ignore:
Timestamp:
03/16/09 22:45:16 (5 years ago)
Author:
ryan
Message:

Move meta widget to WP_Widget. see #8441

File:
1 edited

Legend:

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

    r10796 r10797  
    239239<?php 
    240240    } 
    241 } 
    242  
    243 /** 
    244  * Display meta widget. 
    245  * 
    246  * Displays log in/out, RSS feed links, etc. 
    247  * 
    248  * @since 2.2.0 
    249  * 
    250  * @param array $args Widget arguments. 
    251  */ 
    252 function wp_widget_meta($args) { 
    253     extract($args); 
    254     $options = get_option('widget_meta'); 
    255     $title = empty($options['title']) ? __('Meta') : apply_filters('widget_title', $options['title']); 
    256 ?> 
    257         <?php echo $before_widget; ?> 
    258             <?php echo $before_title . $title . $after_title; ?> 
    259             <ul> 
    260             <?php wp_register(); ?> 
    261             <li><?php wp_loginout(); ?></li> 
    262             <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> 
    263             <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> 
    264             <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> 
    265             <?php wp_meta(); ?> 
    266             </ul> 
    267         <?php echo $after_widget; ?> 
    268 <?php 
    269 } 
    270  
    271 /** 
    272  * Display and process meta widget options form. 
    273  * 
    274  * @since 2.2.0 
    275  */ 
    276 function wp_widget_meta_control() { 
    277     $options = $newoptions = get_option('widget_meta'); 
    278     if ( isset($_POST["meta-submit"]) ) { 
    279         $newoptions['title'] = strip_tags(stripslashes($_POST["meta-title"])); 
    280     } 
    281     if ( $options != $newoptions ) { 
    282         $options = $newoptions; 
    283         update_option('widget_meta', $options); 
    284     } 
    285     $title = attribute_escape($options['title']); 
    286 ?> 
    287             <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> 
    288             <input type="hidden" id="meta-submit" name="meta-submit" value="1" /> 
    289 <?php 
    290241} 
    291242 
     
    13861337    new WP_Widget_Links(); 
    13871338 
    1388     //$widget_ops = array('classname' => 'widget_meta', 'description' => __( "Log in/out, admin, feed and WordPress links") ); 
    1389     //wp_register_sidebar_widget('meta', __('Meta'), 'wp_widget_meta', $widget_ops); 
    1390     //wp_register_widget_control('meta', __('Meta'), 'wp_widget_meta_control' ); 
    13911339    new WP_Widget_Meta(); 
    13921340 
Note: See TracChangeset for help on using the changeset viewer.