Updated templates to handle new notices.
This commit is contained in:
parent
7024fc8483
commit
08b761df4f
|
@ -10,26 +10,24 @@
|
|||
* happen. When this occurs the version of the template file will be bumped and
|
||||
* the readme will list any important changes.
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce/Templates
|
||||
* @version 3.5.0
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce/Templates
|
||||
* @version 3.9.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! $messages ) {
|
||||
if ( ! $notices ) {
|
||||
return;
|
||||
}
|
||||
|
||||
?>
|
||||
<ul class="woocommerce-error" role="alert">
|
||||
<?php foreach ( $messages as $message ) : ?>
|
||||
<li>
|
||||
<?php
|
||||
echo wc_kses_notice( $message );
|
||||
?>
|
||||
<?php foreach ( $notices as $notice ) : ?>
|
||||
<li<?php echo wc_get_notice_data_attr( $notice ); ?>>
|
||||
<?php echo wc_kses_notice( $notice['notice'] ); ?>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
|
|
|
@ -10,25 +10,23 @@
|
|||
* happen. When this occurs the version of the template file will be bumped and
|
||||
* the readme will list any important changes.
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce/Templates
|
||||
* @version 3.5.0
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce/Templates
|
||||
* @version 3.9.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
if ( ! $messages ) {
|
||||
if ( ! $notices ) {
|
||||
return;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<?php foreach ( $messages as $message ) : ?>
|
||||
<div class="woocommerce-info">
|
||||
<?php
|
||||
echo wc_kses_notice( $message );
|
||||
?>
|
||||
<?php foreach ( $notices as $notice ) : ?>
|
||||
<div class="woocommerce-info"<?php echo wc_get_notice_data_attr( $notice ); ?>>
|
||||
<?php echo wc_kses_notice( $notice['notice'] ); ?>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
|
|
|
@ -10,25 +10,23 @@
|
|||
* happen. When this occurs the version of the template file will be bumped and
|
||||
* the readme will list any important changes.
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce/Templates
|
||||
* @version 3.5.0
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce/Templates
|
||||
* @version 3.9.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! $messages ) {
|
||||
if ( ! $notices ) {
|
||||
return;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<?php foreach ( $messages as $message ) : ?>
|
||||
<div class="woocommerce-message" role="alert">
|
||||
<?php
|
||||
echo wc_kses_notice( $message );
|
||||
?>
|
||||
<?php foreach ( $notices as $notice ) : ?>
|
||||
<div class="woocommerce-message"<?php echo wc_get_notice_data_attr( $notice ); ?> role="alert">
|
||||
<?php echo wc_kses_notice( $notice['notice'] ); ?>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
|
|
Loading…
Reference in New Issue