Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: 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
330       * Note: these actions are also fired in wp_ajax_update_widget().
331       *
332       * @since 3.9.0
333       */
334      public function customize_controls_init() {
335           /** This action is documented in wp-admin/includes/ajax-actions.php */
336           do_action( 'load-widgets.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
337
338           /** This action is documented in wp-admin/includes/ajax-actions.php */
339           do_action( 'widgets.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
340
341           /** This action is documented in wp-admin/widgets.php */
342           do_action( 'sidebar_admin_setup' );
343      }
344
345      /**
346       * Ensures widgets are available for all types of previews.
347       *
348       * When in preview, hook to {@see 'customize_register'} for settings after WordPress is loaded
 
Line Code
1714
1715           if ( empty( $_POST['widget-id'] ) ) {
1716                wp_send_json_error( 'missing_widget-id' );
1717           }
1718
1719           /** This action is documented in wp-admin/includes/ajax-actions.php */
1720           do_action( 'load-widgets.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
1721
1722           /** This action is documented in wp-admin/includes/ajax-actions.php */
1723           do_action( 'widgets.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
1724
1725           /** This action is documented in wp-admin/widgets.php */
1726           do_action( 'sidebar_admin_setup' );
1727
1728           $widget_id = $this->get_post_value( 'widget-id' );
1729           $parsed_id = $this->parse_widget_id( $widget_id );
1730           $id_base   = $parsed_id['id_base'];
1731
1732           $is_updating_widget_template = (