Removed author tag and bumped version of templates to 3.5.0, factored out function to one common place.

This commit is contained in:
Peter Fabian 2018-08-21 11:47:50 +02:00
parent 355d95db9d
commit ae05d6e5ea
4 changed files with 26 additions and 36 deletions

View File

@ -3397,3 +3397,23 @@ if ( ! function_exists( 'woocommerce_product_reviews_tab' ) ) {
wc_deprecated_function( 'woocommerce_product_reviews_tab', '2.4' );
}
}
/**
* Filters out the same tags as wp_kses_post, but allows tabindex for <a> element.
*
* @since 3.5.0
* @param string $message Content to filter through kses.
* @return string
*/
function wc_kses_notice( $message ) {
return wp_kses( $message,
array_replace_recursive( // phpcs:ignore PHPCompatibility.PHP.NewFunctions.array_replace_recursiveFound
wp_kses_allowed_html( 'post' ),
array(
'a' => array(
'tabindex' => true,
),
)
)
);
}

View File

@ -11,9 +11,8 @@
* the readme will list any important changes.
*
* @see https://docs.woocommerce.com/document/template-structure/
* @author WooThemes
* @package WooCommerce/Templates
* @version 3.3.0
* @version 3.5.0
*/
if ( ! defined( 'ABSPATH' ) ) {
@ -29,16 +28,7 @@ if ( ! $messages ) {
<?php foreach ( $messages as $message ) : ?>
<li>
<?php
echo wp_kses( $message,
array_replace_recursive(
wp_kses_allowed_html( 'post' ),
array(
'a' => array(
'tabindex' => true,
),
)
) // phpcs:ignore PHPCompatibility.PHP.NewFunctions.array_replace_recursiveFound
);
echo wc_kses_notice( $message ); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
?>
</li>
<?php endforeach; ?>

View File

@ -11,9 +11,8 @@
* the readme will list any important changes.
*
* @see https://docs.woocommerce.com/document/template-structure/
* @author WooThemes
* @package WooCommerce/Templates
* @version 1.6.4
* @version 3.5.0
*/
if ( ! defined( 'ABSPATH' ) ) {
@ -29,16 +28,7 @@ if ( ! $messages ) {
<?php foreach ( $messages as $message ) : ?>
<div class="woocommerce-info">
<?php
echo wp_kses( $message,
array_replace_recursive(
wp_kses_allowed_html( 'post' ),
array(
'a' => array(
'tabindex' => true,
),
)
) // phpcs:ignore PHPCompatibility.PHP.NewFunctions.array_replace_recursiveFound
);
echo wc_kses_notice( $message ); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
?>
</div>
<?php endforeach; ?>

View File

@ -11,9 +11,8 @@
* the readme will list any important changes.
*
* @see https://docs.woocommerce.com/document/template-structure/
* @author WooThemes
* @package WooCommerce/Templates
* @version 3.3.0
* @version 3.5.0
*/
if ( ! defined( 'ABSPATH' ) ) {
@ -29,16 +28,7 @@ if ( ! $messages ) {
<?php foreach ( $messages as $message ) : ?>
<div class="woocommerce-message" role="alert">
<?php
echo wp_kses( $message,
array_replace_recursive(
wp_kses_allowed_html( 'post' ),
array(
'a' => array(
'tabindex' => true,
),
)
) // phpcs:ignore PHPCompatibility.PHP.NewFunctions.array_replace_recursiveFound
);
echo wc_kses_notice( $message ); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
?>
</div>
<?php endforeach; ?>