A WordPress-centric search engine for devs and theme authors



wp_list_widget_controls ›

Since2.5.0
Deprecatedn/a
wp_list_widget_controls ( $sidebar, $sidebar_name = '' )
Parameters: (2)
  • (string) $sidebar Sidebar ID.
    Required: Yes
  • (string) $sidebar_name Optional. Sidebar name. Default empty.
    Required: No
    Default: (empty)
Defined at:
Codex:

Show the widgets and their settings for a sidebar.

Used in the admin widget config screen.



Source

function wp_list_widget_controls( $sidebar, $sidebar_name = '' ) {
	add_filter( 'dynamic_sidebar_params', 'wp_list_widget_controls_dynamic_sidebar' );

	$description = wp_sidebar_description( $sidebar );

	echo '<div id="' . esc_attr( $sidebar ) . '" class="widgets-sortables">';

	if ( $sidebar_name ) {
		?>
		<div class="sidebar-name">
			<button type="button" class="handlediv hide-if-no-js" aria-expanded="true">
				<span class="screen-reader-text"><?php echo esc_html( $sidebar_name ); ?></span>
				<span class="toggle-indicator" aria-hidden="true"></span>
			</button>
			<h2><?php echo esc_html( $sidebar_name ); ?> <span class="spinner"></span></h2>
		</div>
		<?php
	}

	if ( ! empty( $description ) ) {
		?>
		<div class="sidebar-description">
			<p class="description"><?php echo $description; ?></p>
		</div>
		<?php
	}

	dynamic_sidebar( $sidebar );

	echo '</div>';
}