diff --git src/wp-admin/includes/dashboard.php src/wp-admin/includes/dashboard.php
index 0da446d491..35748bc3d9 100644
|
|
|
function wp_dashboard_setup() { |
| 146 | 146 | * @param callable $control_callback Optional. Function that outputs controls for the widget. Default null. |
| 147 | 147 | * @param array $callback_args Optional. Data that should be set as the $args property of the widget array |
| 148 | 148 | * (which is the second parameter passed to your callback). Default null. |
| | 149 | * @param string $context Optional. The context within the screen where the boxes |
| | 150 | * should display. Available contexts vary from screen to |
| | 151 | * screen. Post edit screen contexts include 'normal', 'side', |
| | 152 | * and 'advanced'. Comments screen contexts include 'normal' |
| | 153 | * and 'side'. Menus meta boxes (accordion sections) all use |
| | 154 | * the 'side' context. Default 'default'. |
| | 155 | * @param string $priority Optional. The priority within the context where the boxes |
| | 156 | * should show ('high', 'low'). Default 'default'. |
| 149 | 157 | */ |
| 150 | | function wp_add_dashboard_widget( $widget_id, $widget_name, $callback, $control_callback = null, $callback_args = null ) { |
| | 158 | function wp_add_dashboard_widget( $widget_id, $widget_name, $callback, $control_callback = null, $callback_args = null, $location = 'default', $priority = 'default' ) { |
| 151 | 159 | $screen = get_current_screen(); |
| 152 | 160 | global $wp_dashboard_control_callbacks; |
| 153 | 161 | |
| … |
… |
function wp_add_dashboard_widget( $widget_id, $widget_name, $callback, $control_ |
| 173 | 181 | |
| 174 | 182 | $side_widgets = array( 'dashboard_quick_press', 'dashboard_primary' ); |
| 175 | 183 | |
| 176 | | $location = 'normal'; |
| 177 | | if ( in_array( $widget_id, $side_widgets ) ) { |
| 178 | | $location = 'side'; |
| | 184 | if ( $location === 'default' ) { |
| | 185 | $location = 'normal'; |
| | 186 | if ( in_array( $widget_id, $side_widgets ) ) { |
| | 187 | $location = 'side'; |
| | 188 | } |
| 179 | 189 | } |
| 180 | 190 | |
| 181 | | $priority = 'core'; |
| 182 | | if ( 'dashboard_browser_nag' === $widget_id ) { |
| 183 | | $priority = 'high'; |
| | 191 | if ( $priority === 'default' ) { |
| | 192 | $priority = 'core'; |
| | 193 | if ( 'dashboard_browser_nag' === $widget_id ) { |
| | 194 | $priority = 'high'; |
| | 195 | } |
| 184 | 196 | } |
| 185 | 197 | |
| 186 | 198 | add_meta_box( $widget_id, $widget_name, $callback, $screen, $location, $priority, $callback_args ); |