WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
Line | Code |
---|---|
3 | require_once( 'admin.php' ); |
4 | require_once(ABSPATH . 'wp-admin/includes/widgets.php'); |
5 |
|
6 | if ( ! current_user_can('switch_themes') ) |
7 | wp_die( __( 'Cheatin’ uh?' )); |
8 |
|
9 | wp_enqueue_script( array( 'wp-lists', 'admin-widgets' ) ); |
10 | wp_admin_css( 'widgets' ); |
11 |
|
12 | do_action( 'sidebar_admin_setup' ); |
13 |
|
14 | $title = __( 'Widgets' ); |
15 | $parent_file = 'themes.php'; |
16 |
|
17 | // $sidebar = What sidebar are we editing? |
18 | if ( isset($_GET['sidebar']) && isset($wp_registered_sidebars[$_GET['sidebar']]) ) { |
19 | $sidebar = attribute_escape( $_GET['sidebar'] ); |
20 | } elseif ( is_array($wp_registered_sidebars) && !empty($wp_registered_sidebars) ) { |
21 | // By default we look at the first defined sidebar |