New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wc_notice_count doesn't return the correct notice count for all notices #18412

Closed
obiPlabon opened this Issue Jan 10, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@obiPlabon
Contributor

obiPlabon commented Jan 10, 2018

I've created the notices in the following way. It was supposed to return 6 for the first run but I was getting 9

wc_add_notice( 'Success 1' );
wc_add_notice( 'Success 2' );

wc_add_notice( 'Error 1', 'error' );
wc_add_notice( 'Error 2', 'error' );

wc_add_notice( 'Notice 1', 'notice' );
wc_add_notice( 'Notice 2', 'notice' );

echo '<pre>';

echo 'Number of notices: ' . wc_notice_count();

echo '<hr>';

$n = wc_get_notices();
print_r( $n );

echo '</pre>';
// wc_clear_notices();

Here's the output of 2nd run (when it's supposed to return 12):
wc-notice-bug-output

Thanks

@mikejolley

This comment has been minimized.

Show comment
Hide comment
@mikejolley
Member

mikejolley commented Jan 10, 2018

See #18414

@mikejolley mikejolley closed this Jan 10, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment