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 |
---|---|
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' => '', |