WP_Customize_Widgets::get_widget_control() WordPress Method

The get_widget_control() method is used to get the control for a widget. This is used to display the control for a widget on the Customizer screen.

WP_Customize_Widgets::get_widget_control( array $args ) #

Retrieves the widget control markup.


Parameters

$args

(array)(Required)Widget control arguments.


Top ↑

Return

(string) Widget control form HTML markup.


Top ↑

Source

File: wp-includes/class-wp-customize-widgets.php

	public function get_widget_control( $args ) {
		$args[0]['before_form']           = '<div class="form">';
		$args[0]['after_form']            = '</div><!-- .form -->';
		$args[0]['before_widget_content'] = '<div class="widget-content">';
		$args[0]['after_widget_content']  = '</div><!-- .widget-content -->';
		ob_start();
		wp_widget_control( ...$args );
		$control_tpl = ob_get_clean();
		return $control_tpl;
	}


Top ↑

Changelog

Changelog
VersionDescription
3.9.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.

Show More