PluginProbe
Adminify – White Label, Admin Menu Editor, Login Customizer / 4.3.2
Adminify – White Label, Admin Menu Editor, Login Customizer v4.3.2
4.3.2 4.3.1 4.3.0 4.2.26 4.2.25 4.2.24 4.2.23 4.2.22 4.2.21 4.2.20 4.2.19 4.2.18 4.2.17 4.2.16 4.2.15 4.2.14 4.2.13 4.2.12 4.2.11 4.2.10 4.2.9 4.2.8 4.2.7 4.2.6 4.2.5 All 165 releases
← All changes | Inc/Modules/DashboardWidget/DashboardWidget.php +9 -3 4.2.264.3.2 View file →
@@ -311,13 +311,19 @@
311 311
312 312 foreach ( $options as $value ) {
313 313 if ( is_array( $value ) && ! empty( $value ) ) {
314 314
315 - // Restricted for User Roles
315 + // Allowed User Roles. An empty list means the widget is not limited to
316 + // particular roles, so it shows for everyone — that is the field's
317 + // default, and without this check a newly created widget would never
318 + // appear. Anything else is treated as an allow list.
319 + //
320 + // `continue`, not `return`: skipping one widget must not stop the rest
321 + // of the list from being registered.
316 322 $restricted_for_dash_widget = ! empty( $value['user_roles'] ) ? $value['user_roles'] : '';
317 323
318 - if ( ! Utils::restricted_for( $restricted_for_dash_widget ) ) {
319 - return;
324 + if ( ! empty( $restricted_for_dash_widget ) && ! Utils::restricted_for( $restricted_for_dash_widget ) ) {
325 + continue;
320 326 }
321 327
322 328 $dash_widget_title = isset( $value['title'] ) ? $value['title'] : '';
323 329 $dash_widget_position = isset( $value['widget_pos'] ) ? $value['widget_pos'] : 'normal';