Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: sidebar_admin_setup

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       */
332      public function customize_controls_init() {
333           /** This action is documented in wp-admin/includes/ajax-actions.php */
334           do_action( 'load-widgets.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
335
336           /** This action is documented in wp-admin/includes/ajax-actions.php */
337           do_action( 'widgets.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
338
339           /** This action is documented in wp-admin/widgets.php */
340           do_action( 'sidebar_admin_setup' );
341      }
342
343      /**
344       * Ensures widgets are available for all types of previews.
345       *
346       * When in preview, hook to {@see 'customize_register'} for settings after WordPress is loaded
347       * so that all filters have been initialized (e.g. Widget Visibility).
348       *
349       * @since 3.9.0
 
Line Code
1542           }
1543
1544           /** This action is documented in wp-admin/includes/ajax-actions.php */
1545           do_action( 'load-widgets.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
1546
1547           /** This action is documented in wp-admin/includes/ajax-actions.php */
1548           do_action( 'widgets.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
1549
1550           /** This action is documented in wp-admin/widgets.php */
1551           do_action( 'sidebar_admin_setup' );
1552
1553           $widget_id = $this->get_post_value( 'widget-id' );
1554           $parsed_id = $this->parse_widget_id( $widget_id );
1555           $id_base   = $parsed_id['id_base'];
1556
1557           $is_updating_widget_template = (
1558                isset( $_POST[ 'widget-' . $id_base ] )
1559                &&
1560                is_array( $_POST[ 'widget-' . $id_base ] )