W3cubDocs

/WordPress

WP_Widget_Custom_HTML::form( array $instance )

Outputs the Custom HTML widget settings form.

Description

See also

Parameters

$instance

(array) (Required) Current instance.

Source

File: wp-includes/widgets/class-wp-widget-custom-html.php

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
	}

Changelog

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

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_widget_custom_html/form