wp_list_widget_controls

Show the widgets and their settings for a sidebar.

Description

wp_list_widget_controls( (string) $sidebar, (string) $sidebar_name = '' ); 

Used in the admin widget config screen.

Parameters (2)

0. $sidebar (string)
The sidebar.
1. $sidebar_name — Optional. (string) => ''
Sidebar name. Default empty.

Usage

  1. if ( !function_exists( 'wp_list_widget_controls' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/widgets.php'; 
  3.  
  4. // The sidebar. 
  5. $sidebar = ''; 
  6.  
  7. // Optional. Sidebar name. Default empty. 
  8. $sidebar_name = ''; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = wp_list_widget_controls($sidebar, $sidebar_name); 
  12.  

Defined (1)

The function is defined in the following location(s).

/wp-admin/includes/widgets.php  
  1. function wp_list_widget_controls( $sidebar, $sidebar_name = '' ) { 
  2.  
  3. $description = wp_sidebar_description( $sidebar ); 
  4.  
  5. echo '<div id="' . esc_attr( $sidebar ) . '" class="widgets-sortables">'; 
  6.  
  7. if ( $sidebar_name ) { 
  8. ?> 
  9. <div class="sidebar-name"> 
  10. <div class="sidebar-name-arrow"><br /></div> 
  11. <h2><?php echo esc_html( $sidebar_name ); ?> <span class="spinner"></span></h2> 
  12. </div> 
  13. <?php 
  14.  
  15. if ( ! empty( $description ) ) { 
  16. ?> 
  17. <div class="sidebar-description"> 
  18. <p class="description"><?php echo $description; ?></p> 
  19. </div> 
  20. <?php 
  21.  
  22. dynamic_sidebar( $sidebar ); 
  23.  
  24. echo '</div>';