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