Skip to content

Commit 770e2e1

Browse files
committed
Warn if 0.
1 parent 2aefcd4 commit 770e2e1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

wp-user-signups/includes/functions/admin.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,7 @@ function wp_user_signups_output_admin_notices() {
541541
return;
542542
}
543543

544+
$class = 'notice-success';
544545
$did_action = sanitize_key( $_REQUEST['did_action'] );
545546
$processed = ! empty( $_REQUEST['processed'] )
546547
? wp_parse_id_list( (array) $_REQUEST['processed'] )
@@ -575,6 +576,11 @@ function wp_user_signups_output_admin_notices() {
575576
'add' => _n( '%s signup added.', '%s signups added.', $count, 'wp-user-signups' ),
576577
'edit' => _n( '%s signup updated.', '%s signups updated.', $count, 'wp-user-signups' )
577578
);
579+
580+
// Warn if empty
581+
if ( empty( $count ) ) {
582+
$class = 'notice-warning';
583+
}
578584
}
579585

580586
// Filter bulk messages, allowing for custom ones
@@ -591,5 +597,5 @@ function wp_user_signups_output_admin_notices() {
591597
}
592598

593599
// Output notices
594-
?><div id="message" class="notice notice-success"><p><?php echo implode( '</p><p>', $messages ); ?></p></div><?php
600+
?><div id="message" class="notice <?php echo $class; ?>"><p><?php echo implode( '</p><p>', $messages ); ?></p></div><?php
595601
}

0 commit comments

Comments
 (0)