WP_Widget_Block::form() WordPress Method

The WP_Widget_Block::form() method is used to display a form for a particular widget instance. The form is displayed in the admin section of the site. The user can then fill out the form and save the widget settings.

WP_Widget_Block::form( array $instance ) #

Outputs the Block widget settings form.


Description

Top ↑

See also


Top ↑

Parameters

$instance

(array)(Required)Current instance.


Top ↑

Source

File: wp-includes/widgets/class-wp-widget-block.php

	public function form( $instance ) {
		$instance = wp_parse_args( (array) $instance, $this->default_instance );
		?>
		<p>
			<label for="<?php echo $this->get_field_id( 'content' ); ?>">
				<?php
				/* translators: HTML code of the block, not an option that blocks HTML. */
				_e( 'Block HTML:' );
				?>
			</label>
			<textarea id="<?php echo $this->get_field_id( 'content' ); ?>" name="<?php echo $this->get_field_name( 'content' ); ?>" rows="6" cols="50" class="widefat code"><?php echo esc_textarea( $instance['content'] ); ?></textarea>
		</p>
		<?php
	}


Top ↑

Changelog

Changelog
VersionDescription
5.8.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.