Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: load-widgets-php

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

This hook occurs 2 times in this file.

Line Code
331       * Ensures all widgets get loaded into the Customizer.
332       *
333       * Note: these actions are also fired in wp_ajax_update_widget().
334       *
335       * @since 3.9.0
336       * @access public
337       */
338      public function customize_controls_init() {
339           /** This action is documented in wp-admin/includes/ajax-actions.php */
340           do_action( 'load-widgets.php' );
341
342           /** This action is documented in wp-admin/includes/ajax-actions.php */
343           do_action( 'widgets.php' );
344
345           /** This action is documented in wp-admin/widgets.php */
346           do_action( 'sidebar_admin_setup' );
347      }
348
349      /**
 
Line Code
1479           if ( ! current_user_can( 'edit_theme_options' ) ) {
1480                wp_die( -1 );
1481           }
1482
1483           if ( empty( $_POST['widget-id'] ) ) {
1484                wp_send_json_error( 'missing_widget-id' );
1485           }
1486
1487           /** This action is documented in wp-admin/includes/ajax-actions.php */
1488           do_action( 'load-widgets.php' );
1489
1490           /** This action is documented in wp-admin/includes/ajax-actions.php */
1491           do_action( 'widgets.php' );
1492
1493           /** This action is documented in wp-admin/widgets.php */
1494           do_action( 'sidebar_admin_setup' );
1495
1496           $widget_id = $this->get_post_value( 'widget-id' );
1497           $parsed_id = $this->parse_widget_id( $widget_id );