rebase from live enviornment

This commit is contained in:
Rachit Bhargava
2024-01-09 22:14:20 -05:00
parent ff0b49a046
commit 3a22fcaa4a
15968 changed files with 2344674 additions and 45234 deletions

View File

@@ -129,7 +129,7 @@ function wc_clear_notices() {
*
* @since 2.1
* @param bool $return true to return rather than echo. @since 3.5.0.
* @return string|null
* @return string|void
*/
function wc_print_notices( $return = false ) {
if ( ! did_action( 'woocommerce_init' ) ) {
@@ -137,7 +137,14 @@ function wc_print_notices( $return = false ) {
return;
}
$all_notices = WC()->session->get( 'wc_notices', array() );
$session = WC()->session;
// If the session handler has not initialized, there will be no notices for us to read.
if ( null === $session ) {
return;
}
$all_notices = $session->get( 'wc_notices', array() );
$notice_types = apply_filters( 'woocommerce_notice_types', array( 'error', 'success', 'notice' ) );
// Buffer output.