WP_Customize_Widgets::get_widget_control
Retrieves the widget control markup.
Method of the class: WP_Customize_Widgets{}
No Hooks.
Returns
String. Widget control form HTML markup.
Usage
$WP_Customize_Widgets = new WP_Customize_Widgets(); $WP_Customize_Widgets->get_widget_control( $args );
- $args(array) (required)
- Widget control arguments.
Changelog
| Since 3.9.0 | Introduced. |
WP_Customize_Widgets::get_widget_control() WP Customize Widgets::get widget control code WP 6.9.1
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;
}