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
326      /**
327       * Ensures all widgets get loaded into the Customizer.
328       *
329       * Note: these actions are also fired in wp_ajax_update_widget().
330       *
331       * @since 3.9.0
332       */
333      public function customize_controls_init() {
334           /** This action is documented in wp-admin/includes/ajax-actions.php */
335           do_action( 'load-widgets.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
336
337           /** This action is documented in wp-admin/includes/ajax-actions.php */
338           do_action( 'widgets.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
339
340           /** This action is documented in wp-admin/widgets.php */
341           do_action( 'sidebar_admin_setup' );
342      }
343
344      /**
 
Line Code
1669           if ( ! current_user_can( 'edit_theme_options' ) ) {
1670                wp_die( -1 );
1671           }
1672
1673           if ( empty( $_POST['widget-id'] ) ) {
1674                wp_send_json_error( 'missing_widget-id' );
1675           }
1676
1677           /** This action is documented in wp-admin/includes/ajax-actions.php */
1678           do_action( 'load-widgets.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
1679
1680           /** This action is documented in wp-admin/includes/ajax-actions.php */
1681           do_action( 'widgets.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
1682
1683           /** This action is documented in wp-admin/widgets.php */
1684           do_action( 'sidebar_admin_setup' );
1685
1686           $widget_id = $this->get_post_value( 'widget-id' );
1687           $parsed_id = $this->parse_widget_id( $widget_id );