Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: wp_dashboard_widgets

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
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();