Merged in feature/117-dev-dev01 (pull request #8)
auto-patch 117-dev-dev01-2023-12-15T16_09_06 * auto-patch 117-dev-dev01-2023-12-15T16_09_06
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user