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
273       * Make sure all widgets get loaded into the Customizer.
274       *
275       * Note: these actions are also fired in wp_ajax_update_widget().
276       *
277       * @since 3.9.0
278       * @access public
279       */
280      public function customize_controls_init() {
281           /** This action is documented in wp-admin/includes/ajax-actions.php */
282           do_action( 'load-widgets.php' );
283
284           /** This action is documented in wp-admin/includes/ajax-actions.php */
285           do_action( 'widgets.php' );
286
287           /** This action is documented in wp-admin/widgets.php */
288           do_action( 'sidebar_admin_setup' );
289      }
290
291      /**
 
Line Code
1375           if ( ! current_user_can( 'edit_theme_options' ) ) {
1376                wp_die( -1 );
1377           }
1378
1379           if ( empty( $_POST['widget-id'] ) ) {
1380                wp_send_json_error( 'missing_widget-id' );
1381           }
1382
1383           /** This action is documented in wp-admin/includes/ajax-actions.php */
1384           do_action( 'load-widgets.php' );
1385
1386           /** This action is documented in wp-admin/includes/ajax-actions.php */
1387           do_action( 'widgets.php' );
1388
1389           /** This action is documented in wp-admin/widgets.php */
1390           do_action( 'sidebar_admin_setup' );
1391
1392           $widget_id = $this->get_post_value( 'widget-id' );
1393           $parsed_id = $this->parse_widget_id( $widget_id );