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:
commit
c560a65e1b
|
@ -100,7 +100,7 @@ class WC_Shipping_Flat_Rate extends WC_Shipping_Method {
|
|||
'percent' => '',
|
||||
'min_fee' => '',
|
||||
'max_fee' => '',
|
||||
), $atts );
|
||||
), $atts, 'fee' );
|
||||
|
||||
$calculated_fee = 0;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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.' );
|
||||
|
|
|
@ -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() ),
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue