wppaste
WordPress

WP_Widget_Custom_HTML::update( array $new_instance, array $old_instance ): array

Since
4.8.1
Source
wp-includes/widgets/class-wp-widget-custom-html.php:190
Handles updating settings for the current Custom HTML widget instance.

Parameters

$new_instancearray
New settings for this instance as input by the user via WP_Widget::form().
$old_instancearray
Old settings for this instance.

Return

array
Settings to save or bool false to cancel saving.

Uses · 3

Source

	public function update( $new_instance, $old_instance ) {		$instance          = array_merge( $this->default_instance, $old_instance );		$instance['title'] = sanitize_text_field( $new_instance['title'] );		if ( current_user_can( 'unfiltered_html' ) ) {			$instance['content'] = $new_instance['content'];		} else {			$instance['content'] = wp_kses_post( $new_instance['content'] );		}		return $instance;	}

History

Introduced in 4.8.1. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.0.4 tag, from src/wp-includes/widgets/class-wp-widget-custom-html.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.