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 |
|---|---|
| 130 | $dashboard_widgets = array(); |
| 131 | $dashboard_widgets[] = 'dashboard_recent_comments'; |
| 132 | $dashboard_widgets[] = 'dashboard_incoming_links'; |
| 133 | $dashboard_widgets[] = 'dashboard_primary'; |
| 134 | if ( current_user_can( 'activate_plugins' ) ) |
| 135 | $dashboard_widgets[] = 'dashboard_plugins'; |
| 136 | $dashboard_widgets[] = 'dashboard_secondary'; |
| 137 | |
| 138 | // Filter widget order |
| 139 | $dashboard_widgets = apply_filters( 'wp_dashboard_widgets', $dashboard_widgets ); |
| 140 | |
| 141 | $wp_dashboard_sidebars = array( 'wp_dashboard' => $dashboard_widgets, 'array_version' => 3.5 ); |
| 142 | |
| 143 | add_filter( 'dynamic_sidebar_params', 'wp_dashboard_dynamic_sidebar_params' ); |
| 144 | |
| 145 | if ( 'POST' == $_SERVER['REQUEST_METHOD'] && isset($_POST['widget_id']) ) { |
| 146 | ob_start(); // hack - but the same hack wp-admin/widgets.php uses |
| 147 | wp_dashboard_trigger_widget_control( $_POST['widget_id'] ); |
| 148 | ob_end_clean(); |