Merge pull request #12742 from jtsternberg/patch-1

Add the shortcode name param to shortcodes where it is missing and `shortcode_atts` call where it is missing.
This commit is contained in:
Justin Shreve 2017-01-03 11:05:48 -08:00 committed by GitHub
commit c560a65e1b
6 changed files with 11 additions and 5 deletions

View File

@ -100,7 +100,7 @@ class WC_Shipping_Flat_Rate extends WC_Shipping_Method {
'percent' => '',
'min_fee' => '',
'max_fee' => '',
), $atts );
), $atts, 'fee' );
$calculated_fee = 0;

View File

@ -130,7 +130,7 @@ class WC_Shipping_Legacy_Flat_Rate extends WC_Shipping_Method {
$atts = shortcode_atts( array(
'percent' => '',
'min_fee' => '',
), $atts );
), $atts, 'fee' );
$calculated_fee = 0;

View File

@ -53,13 +53,17 @@ class WC_Shortcode_Cart {
/**
* Output the cart shortcode.
*
* @param array $atts
*/
public static function output() {
public static function output( $atts ) {
// Constants
if ( ! defined( 'WOOCOMMERCE_CART' ) ) {
define( 'WOOCOMMERCE_CART', true );
}
$atts = shortcode_atts( array(), $atts, 'woocommerce_cart' );
// Update Shipping
if ( ! empty( $_POST['calc_shipping'] ) && wp_verify_nonce( $_POST['_wpnonce'], 'woocommerce-cart' ) ) {
self::calculate_shipping();

View File

@ -34,6 +34,8 @@ class WC_Shortcode_Checkout {
return;
}
$atts = shortcode_atts( array(), $atts, 'woocommerce_checkout' );
// Backwards compat with old pay and thanks link arguments
if ( isset( $_GET['order'] ) && isset( $_GET['key'] ) ) {
wc_deprecated_argument( __CLASS__ . '->' . __FUNCTION__, '2.1', '"order" is no longer used to pass an order ID. Use the order-pay or order-received endpoint instead.' );

View File

@ -98,7 +98,7 @@ class WC_Shortcode_My_Account {
private static function my_account( $atts ) {
extract( shortcode_atts( array(
'order_count' => 15, // @deprecated 2.6.0. Keep for backward compatibility.
), $atts ) );
), $atts, 'woocommerce_my_account' ) );
wc_get_template( 'myaccount/my-account.php', array(
'current_user' => get_user_by( 'id', get_current_user_id() ),

View File

@ -33,7 +33,7 @@ class WC_Shortcode_Order_Tracking {
return;
}
extract( shortcode_atts( array(), $atts ) );
extract( shortcode_atts( array(), $atts, 'woocommerce_order_tracking' ) );
global $post;