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

Line Code
12 /** WordPress Administration Widgets API */
13 require_once(ABSPATH . 'wp-admin/includes/widgets.php');
14
15 if ( ! current_user_can('switch_themes') )
16      wp_die( __( 'Cheatin’ uh?' ));
17
18 wp_enqueue_script('admin-widgets');
19 wp_admin_css( 'widgets' );
20
21 do_action( 'sidebar_admin_setup' );
22
23 $title = __( 'Widgets' );
24 $parent_file = 'themes.php';
25
26 // register the inactive_widgets area as sidebar
27 register_sidebar(array(
28      'name' => __('Inactive Widgets'),
29      'id' => 'wp_inactive_widgets',
30      'before_widget' => '',