wppaste
WordPress

WP_Widget_Custom_HTML::form( array $instance )

Since
4.8.1, 4.9.0
Source
wp-includes/widgets/class-wp-widget-custom-html.php:249
Outputs the Custom HTML widget settings form.

Parameters

$instancearray
Current instance.

Uses · 5

  • wp_parse_args()Merges user defined arguments into defaults array.
  • esc_attr()Escaping for HTML attributes.
  • esc_textarea()Escaping for textarea values.
  • WP_Widget_Custom_HTML::get_field_id()
  • WP_Widget_Custom_HTML::get_field_name()

Source

	public function form( $instance ) {		$instance = wp_parse_args( (array) $instance, $this->default_instance );		?>		<input id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" class="title sync-input" type="hidden" value="<?php echo esc_attr( $instance['title'] ); ?>" />		<textarea id="<?php echo $this->get_field_id( 'content' ); ?>" name="<?php echo $this->get_field_name( 'content' ); ?>" class="content sync-input" hidden><?php echo esc_textarea( $instance['content'] ); ?></textarea>		<?php	}

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.

4.9.0
The form contains only hidden sync inputs. For the control UI, see WP_Widget_Custom_HTML::render_control_template_scripts().from the docblock
4.8.1
Introduced.from the docblock

About this page

Parsed data
Generated from the wordpress-develop 6.9.7 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.