wp/wp-includes/widgets/class-wp-widget-calendar.php
changeset 9 177826044cd9
parent 7 cf61fcea0001
child 16 a86126ab1dd4
--- a/wp/wp-includes/widgets/class-wp-widget-calendar.php	Mon Oct 14 18:06:33 2019 +0200
+++ b/wp/wp-includes/widgets/class-wp-widget-calendar.php	Mon Oct 14 18:28:13 2019 +0200
@@ -19,8 +19,6 @@
 	 * Ensure that the ID attribute only appears in the markup once
 	 *
 	 * @since 4.4.0
-	 *
-	 * @static
 	 * @var int
 	 */
 	private static $instance = 0;
@@ -32,8 +30,8 @@
 	 */
 	public function __construct() {
 		$widget_ops = array(
-			'classname' => 'widget_calendar',
-			'description' => __( 'A calendar of your site’s Posts.' ),
+			'classname'                   => 'widget_calendar',
+			'description'                 => __( 'A calendar of your site’s Posts.' ),
 			'customize_selective_refresh' => true,
 		);
 		parent::__construct( 'calendar', __( 'Calendar' ), $widget_ops );
@@ -81,7 +79,7 @@
 	 * @return array Updated settings to save.
 	 */
 	public function update( $new_instance, $old_instance ) {
-		$instance = $old_instance;
+		$instance          = $old_instance;
 		$instance['title'] = sanitize_text_field( $new_instance['title'] );
 
 		return $instance;
@@ -96,10 +94,9 @@
 	 */
 	public function form( $instance ) {
 		$instance = wp_parse_args( (array) $instance, array( 'title' => '' ) );
-		$title = sanitize_text_field( $instance['title'] );
 		?>
-		<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label>
-		<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>
+		<p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>
+		<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( $instance['title'] ); ?>" /></p>
 		<?php
 	}
 }