Changeset 34614
- Timestamp:
- 09/27/2015 12:50:04 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/widgets/class-wp-widget-recent-comments.php
r34581 r34614 9 9 10 10 /** 11 * Core class used to implement a Recent _Comments widget.11 * Core class used to implement a Recent Comments widget. 12 12 * 13 13 * @since 2.8.0 … … 17 17 class WP_Widget_Recent_Comments extends WP_Widget { 18 18 19 /** 20 * Sets up a new Recent Comments widget instance. 21 * 22 * @since 2.8.0 23 * @access public 24 */ 19 25 public function __construct() { 20 26 $widget_ops = array('classname' => 'widget_recent_comments', 'description' => __( 'Your site’s most recent comments.' ) ); … … 26 32 } 27 33 28 /** 34 /** 35 * Outputs the default styles for the Recent Comments widget. 36 * 37 * @since 2.8.0 29 38 * @access public 30 39 */ … … 42 51 return; 43 52 ?> 44 <style type="text/css">.recentcomments a{display:inline !important;padding:0 !important;margin:0 !important;}</style>45 <?php53 <style type="text/css">.recentcomments a{display:inline !important;padding:0 !important;margin:0 !important;}</style> 54 <?php 46 55 } 47 56 48 57 /** 49 * @param array $args 50 * @param array $instance 58 * Outputs the content for the current Recent Comments widget instance. 59 * 60 * @since 2.8.0 61 * @access public 62 * 63 * @param array $args Display arguments including 'before_title', 'after_title', 64 * 'before_widget', and 'after_widget'. 65 * @param array $instance Settings for the current Recent Comments widget instance. 51 66 */ 52 67 public function widget( $args, $instance ) { … … 108 123 109 124 /** 110 * @param array $new_instance 111 * @param array $old_instance 112 * @return array 125 * Handles updating settings for the current Recent Comments widget instance. 126 * 127 * @since 2.8.0 128 * @access public 129 * 130 * @param array $new_instance New settings for this instance as input by the user via 131 * WP_Widget::form(). 132 * @param array $old_instance Old settings for this instance. 133 * @return array Updated settings to save. 113 134 */ 114 135 public function update( $new_instance, $old_instance ) { … … 120 141 121 142 /** 122 * @param array $instance 143 * Outputs the settings form for the Recent Comments widget. 144 * 145 * @since 2.8.0 146 * @access public 147 * 148 * @param array $instance Current settings. 123 149 */ 124 150 public function form( $instance ) { 125 151 $title = isset( $instance['title'] ) ? $instance['title'] : ''; 126 152 $number = isset( $instance['number'] ) ? absint( $instance['number'] ) : 5; 127 ?>153 ?> 128 154 <p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label> 129 155 <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /></p> … … 131 157 <p><label for="<?php echo $this->get_field_id( 'number' ); ?>"><?php _e( 'Number of comments to show:' ); ?></label> 132 158 <input class="tiny-text" id="<?php echo $this->get_field_id( 'number' ); ?>" name="<?php echo $this->get_field_name( 'number' ); ?>" type="number" step="1" min="1" value="<?php echo $number; ?>" size="3" /></p> 133 <?php159 <?php 134 160 } 135 161 }
Note: See TracChangeset
for help on using the changeset viewer.