Use $messages variable for all notice templates

This commit is contained in:
thenbrent 2013-11-13 16:19:59 -08:00
parent a7a7a8ee08
commit 3c625eba5f
3 changed files with 8 additions and 8 deletions

View File

@ -80,7 +80,7 @@ function wc_print_notices() {
foreach ( $notice_types as $notice_type ) {
if ( wc_notice_count( $notice_type ) > 0 ) {
woocommerce_get_template( "notices/{$notice_type}.php", array(
"{$notice_type}s" => $all_notices[$notice_type]
'messages' => $all_notices[$notice_type]
) );
}
}
@ -102,7 +102,7 @@ function wc_print_notice( $message, $notice_type = 'success' ) {
$message = apply_filters( 'woocommerce_add_message', $message );
woocommerce_get_template( "notices/{$notice_type}.php", array(
"{$notice_type}s" => array( apply_filters( 'woocommerce_add_' . $notice_type, $message ) )
'messages' => array( apply_filters( 'woocommerce_add_' . $notice_type, $message ) )
) );
}

View File

@ -9,10 +9,10 @@
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
if ( ! $errors ) return;
if ( ! $messages ) return;
?>
<ul class="woocommerce-error">
<?php foreach ( $errors as $error ) : ?>
<li><?php echo wp_kses_post( $error ); ?></li>
<?php foreach ( $messages as $message ) : ?>
<li><?php echo wp_kses_post( $message ); ?></li>
<?php endforeach; ?>
</ul>

View File

@ -9,9 +9,9 @@
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
if ( ! $notices ) return;
if ( ! $messages ) return;
?>
<?php foreach ( $notices as $notice ) : ?>
<div class="woocommerce-info"><?php echo wp_kses_post( $notice ); ?></div>
<?php foreach ( $messages as $message ) : ?>
<div class="woocommerce-info"><?php echo wp_kses_post( $message ); ?></div>
<?php endforeach; ?>