last item in a multiline-array should end in a comma

This commit is contained in:
Aristeides Stathopoulos 2016-08-27 04:46:45 +03:00
parent 53f3b35c7e
commit b063bcfe4c
228 changed files with 1494 additions and 1494 deletions

View File

@ -169,7 +169,7 @@ class WC_HookFinder {
'class' => $current_class,
'function' => $current_function,
'file' => array( self::$current_file ),
'type' => $token_type
'type' => $token_type,
);
}
break;

View File

@ -15,10 +15,10 @@ return array(
'state' => '',
'rate' => '10.0000',
'name' => 'GST',
'shipping' => true
'shipping' => true,
)
)
)
),
),
),
'BD' => array(
'currency_code' => 'BDT',
@ -35,10 +35,10 @@ return array(
'state' => '',
'rate' => '15.0000',
'name' => 'VAT',
'shipping' => true
'shipping' => true,
)
)
)
),
),
),
'BE' => array(
'currency_code' => 'EUR',
@ -55,10 +55,10 @@ return array(
'state' => '',
'rate' => '20.0000',
'name' => 'BTW',
'shipping' => true
'shipping' => true,
)
)
)
),
),
),
'BR' => array(
'currency_code' => 'BRL',
@ -68,7 +68,7 @@ return array(
'num_decimals' => 2,
'weight_unit' => 'kg',
'dimension_unit' => 'cm',
'tax_rates' => array()
'tax_rates' => array(),
),
'CA' => array(
'currency_code' => 'CAD',
@ -86,7 +86,7 @@ return array(
'rate' => '7.0000',
'name' => _x( 'PST', 'Canadian Tax Rates', 'woocommerce' ),
'shipping' => false,
'priority' => 2
'priority' => 2,
)
),
'SK' => array(
@ -96,7 +96,7 @@ return array(
'rate' => '5.0000',
'name' => _x( 'PST', 'Canadian Tax Rates', 'woocommerce' ),
'shipping' => false,
'priority' => 2
'priority' => 2,
)
),
'MB' => array(
@ -106,7 +106,7 @@ return array(
'rate' => '8.0000',
'name' => _x( 'PST', 'Canadian Tax Rates', 'woocommerce' ),
'shipping' => false,
'priority' => 2
'priority' => 2,
)
),
'QC' => array(
@ -116,7 +116,7 @@ return array(
'rate' => '9.975',
'name' => _x( 'QST', 'Canadian Tax Rates', 'woocommerce' ),
'shipping' => false,
'priority' => 2
'priority' => 2,
)
),
'*' => array(
@ -125,94 +125,94 @@ return array(
'state' => 'ON',
'rate' => '13.0000',
'name' => _x( 'HST', 'Canadian Tax Rates', 'woocommerce' ),
'shipping' => true
'shipping' => true,
),
array(
'country' => 'CA',
'state' => 'NL',
'rate' => '13.0000',
'name' => _x( 'HST', 'Canadian Tax Rates', 'woocommerce' ),
'shipping' => true
'shipping' => true,
),
array(
'country' => 'CA',
'state' => 'NB',
'rate' => '13.0000',
'name' => _x( 'HST', 'Canadian Tax Rates', 'woocommerce' ),
'shipping' => true
'shipping' => true,
),
array(
'country' => 'CA',
'state' => 'PE',
'rate' => '14.0000',
'name' => _x( 'HST', 'Canadian Tax Rates', 'woocommerce' ),
'shipping' => true
'shipping' => true,
),
array(
'country' => 'CA',
'state' => 'NS',
'rate' => '15.0000',
'name' => _x( 'HST', 'Canadian Tax Rates', 'woocommerce' ),
'shipping' => true
'shipping' => true,
),
array(
'country' => 'CA',
'state' => 'AB',
'rate' => '5.0000',
'name' => _x( 'GST', 'Canadian Tax Rates', 'woocommerce' ),
'shipping' => true
'shipping' => true,
),
array(
'country' => 'CA',
'state' => 'BC',
'rate' => '5.0000',
'name' => _x( 'GST', 'Canadian Tax Rates', 'woocommerce' ),
'shipping' => true
'shipping' => true,
),
array(
'country' => 'CA',
'state' => 'NT',
'rate' => '5.0000',
'name' => _x( 'GST', 'Canadian Tax Rates', 'woocommerce' ),
'shipping' => true
'shipping' => true,
),
array(
'country' => 'CA',
'state' => 'NU',
'rate' => '5.0000',
'name' => _x( 'GST', 'Canadian Tax Rates', 'woocommerce' ),
'shipping' => true
'shipping' => true,
),
array(
'country' => 'CA',
'state' => 'YT',
'rate' => '5.0000',
'name' => _x( 'GST', 'Canadian Tax Rates', 'woocommerce' ),
'shipping' => true
'shipping' => true,
),
array(
'country' => 'CA',
'state' => 'SK',
'rate' => '5.0000',
'name' => _x( 'GST', 'Canadian Tax Rates', 'woocommerce' ),
'shipping' => true
'shipping' => true,
),
array(
'country' => 'CA',
'state' => 'MB',
'rate' => '5.0000',
'name' => _x( 'GST', 'Canadian Tax Rates', 'woocommerce' ),
'shipping' => true
'shipping' => true,
),
array(
'country' => 'CA',
'state' => 'QC',
'rate' => '5.0000',
'name' => _x( 'GST', 'Canadian Tax Rates', 'woocommerce' ),
'shipping' => true
'shipping' => true,
)
)
)
),
),
),
'DE' => array(
'currency_code' => 'EUR',
@ -229,10 +229,10 @@ return array(
'state' => '',
'rate' => '19.0000',
'name' => 'Mwst.',
'shipping' => true
'shipping' => true,
)
)
)
),
),
),
'ES' => array(
'currency_code' => 'EUR',
@ -249,10 +249,10 @@ return array(
'state' => '',
'rate' => '21.0000',
'name' => 'VAT',
'shipping' => true
'shipping' => true,
)
)
)
),
),
),
'FR' => array(
'currency_code' => 'EUR',
@ -269,10 +269,10 @@ return array(
'state' => '',
'rate' => '20.0000',
'name' => 'VAT',
'shipping' => true
'shipping' => true,
)
)
)
),
),
),
'GB' => array(
'currency_code' => 'GBP',
@ -289,10 +289,10 @@ return array(
'state' => '',
'rate' => '20.0000',
'name' => 'VAT',
'shipping' => true
'shipping' => true,
)
)
)
),
),
),
'HU' => array(
'currency_code' => 'HUF',
@ -309,10 +309,10 @@ return array(
'state' => '',
'rate' => '27.0000',
'name' => 'ÁFA',
'shipping' => true
'shipping' => true,
)
)
)
),
),
),
'IT' => array(
'currency_code' => 'EUR',
@ -329,10 +329,10 @@ return array(
'state' => '',
'rate' => '22.0000',
'name' => 'IVA',
'shipping' => true
'shipping' => true,
)
)
)
),
),
),
'JP' => array(
'currency_code' => 'JPY',
@ -349,10 +349,10 @@ return array(
'state' => '',
'rate' => '8.0000',
'name' => __( 'Consumption tax', 'woocommerce' ),
'shipping' => true
'shipping' => true,
)
)
)
),
),
),
'NL' => array(
'currency_code' => 'EUR',
@ -369,10 +369,10 @@ return array(
'state' => '',
'rate' => '21.0000',
'name' => 'VAT',
'shipping' => true
'shipping' => true,
)
)
)
),
),
),
'NO' => array(
'currency_code' => 'Kr',
@ -389,10 +389,10 @@ return array(
'state' => '',
'rate' => '25.0000',
'name' => 'MVA',
'shipping' => true
'shipping' => true,
)
)
)
),
),
),
'NP' => array(
'currency_code' => 'NPR',
@ -409,10 +409,10 @@ return array(
'state' => '',
'rate' => '13.0000',
'name' => 'VAT',
'shipping' => true
'shipping' => true,
)
)
)
),
),
),
'PL' => array(
'currency_code' => 'PLN',
@ -429,10 +429,10 @@ return array(
'state' => '',
'rate' => '23.0000',
'name' => 'VAT',
'shipping' => true
'shipping' => true,
)
)
)
),
),
),
'TH' => array(
'currency_code' => 'THB',
@ -449,10 +449,10 @@ return array(
'state' => '',
'rate' => '7.0000',
'name' => 'VAT',
'shipping' => true
'shipping' => true,
)
)
)
),
),
),
'TR' => array(
'currency_code' => 'TRY',
@ -469,10 +469,10 @@ return array(
'state' => '',
'rate' => '18.0000',
'name' => 'KDV',
'shipping' => true
'shipping' => true,
)
)
)
),
),
),
'US' => array(
'currency_code' => 'USD',
@ -489,7 +489,7 @@ return array(
'state' => 'AL',
'rate' => '4.0000',
'name' => 'State Tax',
'shipping' => false
'shipping' => false,
)
),
'AZ' => array(
@ -498,7 +498,7 @@ return array(
'state' => 'AZ',
'rate' => '5.6000',
'name' => 'State Tax',
'shipping' => false
'shipping' => false,
)
),
'AR' => array(
@ -507,7 +507,7 @@ return array(
'state' => 'AR',
'rate' => '6.5000',
'name' => 'State Tax',
'shipping' => true
'shipping' => true,
)
),
'CA' => array(
@ -516,7 +516,7 @@ return array(
'state' => 'CA',
'rate' => '7.5000',
'name' => 'State Tax',
'shipping' => false
'shipping' => false,
)
),
'CO' => array(
@ -525,7 +525,7 @@ return array(
'state' => 'CO',
'rate' => '2.9000',
'name' => 'State Tax',
'shipping' => false
'shipping' => false,
)
),
'CT' => array(
@ -534,7 +534,7 @@ return array(
'state' => 'CT',
'rate' => '6.3500',
'name' => 'State Tax',
'shipping' => true
'shipping' => true,
)
),
'DC' => array(
@ -543,7 +543,7 @@ return array(
'state' => 'DC',
'rate' => '5.7500',
'name' => 'State Tax',
'shipping' => true
'shipping' => true,
)
),
'FL' => array(
@ -552,7 +552,7 @@ return array(
'state' => 'FL',
'rate' => '6.0000',
'name' => 'State Tax',
'shipping' => true
'shipping' => true,
)
),
'GA' => array(
@ -561,7 +561,7 @@ return array(
'state' => 'GA',
'rate' => '4.0000',
'name' => 'State Tax',
'shipping' => true
'shipping' => true,
)
),
'GU' => array(
@ -570,7 +570,7 @@ return array(
'state' => 'GU',
'rate' => '4.0000',
'name' => 'State Tax',
'shipping' => false
'shipping' => false,
)
),
'HI' => array(
@ -579,7 +579,7 @@ return array(
'state' => 'HI',
'rate' => '4.0000',
'name' => 'State Tax',
'shipping' => true
'shipping' => true,
)
),
'ID' => array(
@ -588,7 +588,7 @@ return array(
'state' => 'ID',
'rate' => '6.0000',
'name' => 'State Tax',
'shipping' => false
'shipping' => false,
)
),
'IL' => array(
@ -597,7 +597,7 @@ return array(
'state' => 'IL',
'rate' => '6.2500',
'name' => 'State Tax',
'shipping' => false
'shipping' => false,
)
),
'IN' => array(
@ -606,7 +606,7 @@ return array(
'state' => 'IN',
'rate' => '7.0000',
'name' => 'State Tax',
'shipping' => false
'shipping' => false,
)
),
'IA' => array(
@ -615,7 +615,7 @@ return array(
'state' => 'IA',
'rate' => '6.0000',
'name' => 'State Tax',
'shipping' => false
'shipping' => false,
)
),
'KS' => array(
@ -624,7 +624,7 @@ return array(
'state' => 'KS',
'rate' => '6.1500',
'name' => 'State Tax',
'shipping' => true
'shipping' => true,
)
),
'KY' => array(
@ -633,7 +633,7 @@ return array(
'state' => 'KY',
'rate' => '6.0000',
'name' => 'State Tax',
'shipping' => true
'shipping' => true,
)
),
'LA' => array(
@ -642,7 +642,7 @@ return array(
'state' => 'LA',
'rate' => '4.0000',
'name' => 'State Tax',
'shipping' => false
'shipping' => false,
)
),
'ME' => array(
@ -651,7 +651,7 @@ return array(
'state' => 'ME',
'rate' => '5.5000',
'name' => 'State Tax',
'shipping' => false
'shipping' => false,
)
),
'MD' => array(
@ -660,7 +660,7 @@ return array(
'state' => 'MD',
'rate' => '6.0000',
'name' => 'State Tax',
'shipping' => false
'shipping' => false,
)
),
'MA' => array(
@ -669,7 +669,7 @@ return array(
'state' => 'MA',
'rate' => '6.2500',
'name' => 'State Tax',
'shipping' => false
'shipping' => false,
)
),
'MI' => array(
@ -678,7 +678,7 @@ return array(
'state' => 'MI',
'rate' => '6.0000',
'name' => 'State Tax',
'shipping' => true
'shipping' => true,
)
),
'MN' => array(
@ -687,7 +687,7 @@ return array(
'state' => 'MN',
'rate' => '6.8750',
'name' => 'State Tax',
'shipping' => true
'shipping' => true,
)
),
'MS' => array(
@ -696,7 +696,7 @@ return array(
'state' => 'MS',
'rate' => '7.0000',
'name' => 'State Tax',
'shipping' => true
'shipping' => true,
)
),
'MO' => array(
@ -705,7 +705,7 @@ return array(
'state' => 'MO',
'rate' => '4.225',
'name' => 'State Tax',
'shipping' => false
'shipping' => false,
)
),
'NE' => array(
@ -714,7 +714,7 @@ return array(
'state' => 'NE',
'rate' => '5.5000',
'name' => 'State Tax',
'shipping' => true
'shipping' => true,
)
),
'NV' => array(
@ -723,7 +723,7 @@ return array(
'state' => 'NV',
'rate' => '6.8500',
'name' => 'State Tax',
'shipping' => false
'shipping' => false,
)
),
'NJ' => array(
@ -732,7 +732,7 @@ return array(
'state' => 'NJ',
'rate' => '7.0000',
'name' => 'State Tax',
'shipping' => true
'shipping' => true,
)
),
'NM' => array(
@ -741,7 +741,7 @@ return array(
'state' => 'NM',
'rate' => '5.1250',
'name' => 'State Tax',
'shipping' => true
'shipping' => true,
)
),
'NY' => array(
@ -750,7 +750,7 @@ return array(
'state' => 'NY',
'rate' => '4.0000',
'name' => 'State Tax',
'shipping' => true
'shipping' => true,
)
),
'NC' => array(
@ -759,7 +759,7 @@ return array(
'state' => 'NC',
'rate' => '4.7500',
'name' => 'State Tax',
'shipping' => true
'shipping' => true,
)
),
'ND' => array(
@ -768,7 +768,7 @@ return array(
'state' => 'ND',
'rate' => '5.0000',
'name' => 'State Tax',
'shipping' => true
'shipping' => true,
)
),
'OH' => array(
@ -777,7 +777,7 @@ return array(
'state' => 'OH',
'rate' => '5.7500',
'name' => 'State Tax',
'shipping' => true
'shipping' => true,
)
),
'OK' => array(
@ -786,7 +786,7 @@ return array(
'state' => 'OK',
'rate' => '4.5000',
'name' => 'State Tax',
'shipping' => false
'shipping' => false,
)
),
'PA' => array(
@ -795,7 +795,7 @@ return array(
'state' => 'PA',
'rate' => '6.0000',
'name' => 'State Tax',
'shipping' => true
'shipping' => true,
)
),
'PR' => array(
@ -804,7 +804,7 @@ return array(
'state' => 'PR',
'rate' => '6.0000',
'name' => 'State Tax',
'shipping' => false
'shipping' => false,
)
),
'RI' => array(
@ -813,7 +813,7 @@ return array(
'state' => 'RI',
'rate' => '7.0000',
'name' => 'State Tax',
'shipping' => false
'shipping' => false,
)
),
'SC' => array(
@ -822,7 +822,7 @@ return array(
'state' => 'SC',
'rate' => '6.0000',
'name' => 'State Tax',
'shipping' => true
'shipping' => true,
)
),
'SD' => array(
@ -831,7 +831,7 @@ return array(
'state' => 'SD',
'rate' => '4.0000',
'name' => 'State Tax',
'shipping' => true
'shipping' => true,
)
),
'TN' => array(
@ -840,7 +840,7 @@ return array(
'state' => 'TN',
'rate' => '7.0000',
'name' => 'State Tax',
'shipping' => true
'shipping' => true,
)
),
'TX' => array(
@ -849,7 +849,7 @@ return array(
'state' => 'TX',
'rate' => '6.2500',
'name' => 'State Tax',
'shipping' => true
'shipping' => true,
)
),
'UT' => array(
@ -858,7 +858,7 @@ return array(
'state' => 'UT',
'rate' => '5.9500',
'name' => 'State Tax',
'shipping' => false
'shipping' => false,
)
),
'VT' => array(
@ -867,7 +867,7 @@ return array(
'state' => 'VT',
'rate' => '6.0000',
'name' => 'State Tax',
'shipping' => true
'shipping' => true,
)
),
'VA' => array(
@ -876,7 +876,7 @@ return array(
'state' => 'VA',
'rate' => '5.3000',
'name' => 'State Tax',
'shipping' => false
'shipping' => false,
)
),
'WA' => array(
@ -885,7 +885,7 @@ return array(
'state' => 'WA',
'rate' => '6.5000',
'name' => 'State Tax',
'shipping' => true
'shipping' => true,
)
),
'WV' => array(
@ -894,7 +894,7 @@ return array(
'state' => 'WV',
'rate' => '6.0000',
'name' => 'State Tax',
'shipping' => true
'shipping' => true,
)
),
'WI' => array(
@ -903,7 +903,7 @@ return array(
'state' => 'WI',
'rate' => '5.0000',
'name' => 'State Tax',
'shipping' => true
'shipping' => true,
)
),
'WY' => array(
@ -912,10 +912,10 @@ return array(
'state' => 'WY',
'rate' => '4.0000',
'name' => 'State Tax',
'shipping' => true
'shipping' => true,
)
)
)
),
),
),
'ZA' => array(
'currency_code' => 'ZAR',
@ -932,9 +932,9 @@ return array(
'state' => '',
'rate' => '14.0000',
'name' => 'VAT',
'shipping' => true
'shipping' => true,
)
)
)
)
),
),
),
);

View File

@ -33,5 +33,5 @@ $states['AR'] = array(
'S' => __( 'Santa Fe', 'woocommerce' ),
'G' => __( 'Santiago del Estero', 'woocommerce' ),
'V' => __( 'Tierra del Fuego', 'woocommerce' ),
'T' => __( 'Tucumán', 'woocommerce' )
'T' => __( 'Tucumán', 'woocommerce' ),
);

View File

@ -17,5 +17,5 @@ $states['AU'] = array(
'SA' => __( 'South Australia', 'woocommerce' ),
'TAS' => __( 'Tasmania', 'woocommerce' ),
'VIC' => __( 'Victoria', 'woocommerce' ),
'WA' => __( 'Western Australia', 'woocommerce' )
'WA' => __( 'Western Australia', 'woocommerce' ),
);

View File

@ -73,5 +73,5 @@ $states['BD'] = array(
'SUN' => __( 'Sunamganj', 'woocommerce' ),
'SYL' => __( 'Sylhet', 'woocommerce' ),
'TAN' => __( 'Tangail', 'woocommerce' ),
'THA' => __( 'Thakurgaon', 'woocommerce' )
'THA' => __( 'Thakurgaon', 'woocommerce' ),
);

View File

@ -36,5 +36,5 @@ $states['BR'] = array(
'SC' => __( 'Santa Catarina', 'woocommerce' ),
'SP' => __( 'São Paulo', 'woocommerce' ),
'SE' => __( 'Sergipe', 'woocommerce' ),
'TO' => __( 'Tocantins', 'woocommerce' )
'TO' => __( 'Tocantins', 'woocommerce' ),
);

View File

@ -22,5 +22,5 @@ $states['CA'] = array(
'PE' => __( 'Prince Edward Island', 'woocommerce' ),
'QC' => __( 'Quebec', 'woocommerce' ),
'SK' => __( 'Saskatchewan', 'woocommerce' ),
'YT' => __( 'Yukon Territory', 'woocommerce' )
'YT' => __( 'Yukon Territory', 'woocommerce' ),
);

View File

@ -41,5 +41,5 @@ $states['CN'] = array(
'CN29' => __( 'Ningxia Hui / 宁夏', 'woocommerce' ),
'CN30' => __( 'Macau / 澳门', 'woocommerce' ),
'CN31' => __( 'Tibet / 西藏', 'woocommerce' ),
'CN32' => __( 'Xinjiang / 新疆', 'woocommerce' )
'CN32' => __( 'Xinjiang / 新疆', 'woocommerce' ),
);

View File

@ -61,5 +61,5 @@ $states['ES'] = array(
'VA' => __( 'Valladolid', 'woocommerce' ),
'BI' => __( 'Bizkaia', 'woocommerce' ),
'ZA' => __( 'Zamora', 'woocommerce' ),
'Z' => __( 'Zaragoza', 'woocommerce' )
'Z' => __( 'Zaragoza', 'woocommerce' ),
);

View File

@ -22,5 +22,5 @@ $states['GR'] = array(
'J' => __( 'Πελοπόννησος', 'woocommerce' ),
'K' => __( 'Βόρειο Αιγαίο', 'woocommerce' ),
'L' => __( 'Νότιο Αιγαίο', 'woocommerce' ),
'M' => __( 'Κρήτη', 'woocommerce' )
'M' => __( 'Κρήτη', 'woocommerce' ),
);

View File

@ -12,5 +12,5 @@ global $states;
$states['HK'] = array(
'HONG KONG' => __( 'Hong Kong Island', 'woocommerce' ),
'KOWLOON' => __( 'Kowloon', 'woocommerce' ),
'NEW TERRITORIES' => __( 'New Territories', 'woocommerce' )
'NEW TERRITORIES' => __( 'New Territories', 'woocommerce' ),
);

View File

@ -29,5 +29,5 @@ $states['HU'] = array(
'TO' => __( 'Tolna', 'woocommerce' ),
'VA' => __( 'Vas', 'woocommerce' ),
'VE' => __( 'Veszprém', 'woocommerce' ),
'ZA' => __( 'Zala', 'woocommerce' )
'ZA' => __( 'Zala', 'woocommerce' ),
);

View File

@ -43,5 +43,5 @@ $states['ID'] = array(
'MA' => __( 'Maluku', 'woocommerce' ),
'MU' => __( 'Maluku Utara', 'woocommerce' ),
'PA' => __( 'Papua', 'woocommerce' ),
'PB' => __( 'Papua Barat', 'woocommerce' )
'PB' => __( 'Papua Barat', 'woocommerce' ),
);

View File

@ -45,5 +45,5 @@ $states['IN'] = array(
'DD' => __( 'Daman and Diu', 'woocommerce' ),
'DL' => __( 'Delhi', 'woocommerce' ),
'LD' => __( 'Lakshadeep', 'woocommerce' ),
'PY' => __( 'Pondicherry (Puducherry)', 'woocommerce' )
'PY' => __( 'Pondicherry (Puducherry)', 'woocommerce' ),
);

View File

@ -40,5 +40,5 @@ $states['IR'] = array(
'MZN' => __( 'Mazandaran (مازندران)', 'woocommerce' ),
'MKZ' => __( 'Markazi (مرکزی)', 'woocommerce' ),
'HRZ' => __( 'Hormozgan (هرمزگان)', 'woocommerce' ),
'SBN' => __( 'Sistan and Baluchestan (سیستان و بلوچستان)', 'woocommerce' )
'SBN' => __( 'Sistan and Baluchestan (سیستان و بلوچستان)', 'woocommerce' ),
);

View File

@ -119,5 +119,5 @@ $states['IT'] = array(
'VR' => __( 'Verona', 'woocommerce' ),
'VV' => __( 'Vibo Valentia', 'woocommerce' ),
'VI' => __( 'Vicenza', 'woocommerce' ),
'VT' => __( 'Viterbo', 'woocommerce' )
'VT' => __( 'Viterbo', 'woocommerce' ),
);

View File

@ -41,5 +41,5 @@ $states['MX'] = array(
'Tlaxcala' => __( 'Tlaxcala', 'woocommerce' ),
'Veracruz' => __( 'Veracruz', 'woocommerce' ),
'Yucatan' => __( 'Yucatán', 'woocommerce' ),
'Zacatecas' => __( 'Zacatecas', 'woocommerce' )
'Zacatecas' => __( 'Zacatecas', 'woocommerce' ),
);

View File

@ -25,5 +25,5 @@ $states['MY'] = array(
'SGR' => __( 'Selangor', 'woocommerce' ),
'TRG' => __( 'Terengganu', 'woocommerce' ),
'PJY' => __( 'Putrajaya', 'woocommerce' ),
'KUL' => __( 'Kuala Lumpur', 'woocommerce' )
'KUL' => __( 'Kuala Lumpur', 'woocommerce' ),
);

View File

@ -23,5 +23,5 @@ $states['NP'] = array(
'NAR' => __( 'Narayani', 'woocommerce' ),
'RAP' => __( 'Rapti', 'woocommerce' ),
'SAG' => __( 'Sagarmatha', 'woocommerce' ),
'SET' => __( 'Seti', 'woocommerce' )
'SET' => __( 'Seti', 'woocommerce' ),
);

View File

@ -35,5 +35,5 @@ $states['PE'] = array(
'SAM' => __( 'San Martín', 'woocommerce' ),
'TAC' => __( 'Tacna', 'woocommerce' ),
'TUM' => __( 'Tumbes', 'woocommerce' ),
'UCA' => __( 'Ucayali', 'woocommerce' )
'UCA' => __( 'Ucayali', 'woocommerce' ),
);

View File

@ -86,5 +86,5 @@ $states['TH'] = array(
'TH-61' => __( 'Uthai Thani (อุทัยธานี)', 'woocommerce' ),
'TH-53' => __( 'Uttaradit (อุตรดิตถ์)', 'woocommerce' ),
'TH-95' => __( 'Yala (ยะลา)', 'woocommerce' ),
'TH-35' => __( 'Yasothon (ยโสธร)', 'woocommerce' )
'TH-35' => __( 'Yasothon (ยโสธร)', 'woocommerce' ),
);

View File

@ -18,5 +18,5 @@ $states['ZA'] = array(
'MP' => __( 'Mpumalanga', 'woocommerce' ),
'NC' => __( 'Northern Cape', 'woocommerce' ),
'NW' => __( 'North West', 'woocommerce' ),
'WC' => __( 'Western Cape', 'woocommerce' )
'WC' => __( 'Western Cape', 'woocommerce' ),
);

View File

@ -243,7 +243,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
'post_parent' => $this->get_parent_id(),
),
array(
'ID' => $order_id
'ID' => $order_id,
)
);
@ -625,7 +625,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
return array(
'from' => $old_status,
'to' => $new_status
'to' => $new_status,
);
}
@ -1586,7 +1586,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
}
$total_rows[ 'fee_' . $fee->get_id() ] = array(
'label' => $fee->get_name() . ':',
'value' => wc_price( 'excl' === $tax_display ? $fee->get_total() : $fee->get_total() + $fee->get_total_tax(), array('currency' => $this->get_currency()) )
'value' => wc_price( 'excl' === $tax_display ? $fee->get_total() : $fee->get_total() + $fee->get_total_tax(), array('currency' => $this->get_currency()) ),
);
}
}

View File

@ -400,7 +400,7 @@ class WC_Product {
if ( ! is_array( $file ) ) {
$downloadable_files[ $key ] = array(
'file' => $file,
'name' => ''
'name' => '',
);
}
@ -1524,7 +1524,7 @@ class WC_Product {
*/
public function list_attributes() {
wc_get_template( 'single-product/product-attributes.php', array(
'product' => $this
'product' => $this,
) );
}

View File

@ -838,7 +838,7 @@ abstract class WC_Settings_API {
return wp_kses( trim( stripslashes( $value ) ),
array_merge(
array(
'iframe' => array( 'src' => true, 'style' => true, 'id' => true, 'class' => true )
'iframe' => array( 'src' => true, 'style' => true, 'id' => true, 'class' => true ),
),
wp_kses_allowed_html( 'post' )
)

View File

@ -52,7 +52,7 @@ abstract class WC_Widget extends WP_Widget {
$widget_ops = array(
'classname' => $this->widget_cssclass,
'description' => $this->widget_description,
'customize_selective_refresh' => true
'customize_selective_refresh' => true,
);
parent::__construct( $this->widget_id, $this->widget_name, $widget_ops );

View File

@ -25,7 +25,7 @@ class WC_Admin_API_Keys_Table_List extends WP_List_Table {
parent::__construct( array(
'singular' => __( 'key', 'woocommerce' ),
'plural' => __( 'keys', 'woocommerce' ),
'ajax' => false
'ajax' => false,
) );
}
@ -41,7 +41,7 @@ class WC_Admin_API_Keys_Table_List extends WP_List_Table {
'truncated_key' => __( 'Consumer Key Ending In', 'woocommerce' ),
'user' => __( 'User', 'woocommerce' ),
'permissions' => __( 'Permissions', 'woocommerce' ),
'last_access' => __( 'Last Access', 'woocommerce' )
'last_access' => __( 'Last Access', 'woocommerce' ),
);
}
@ -78,7 +78,7 @@ class WC_Admin_API_Keys_Table_List extends WP_List_Table {
$actions = array(
'id' => sprintf( __( 'ID: %d', 'woocommerce' ), $key['key_id'] ),
'edit' => '<a href="' . esc_url( $url ) . '">' . __( 'View/Edit', 'woocommerce' ) . '</a>',
'trash' => '<a class="submitdelete" title="' . esc_attr__( 'Revoke API Key', 'woocommerce' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'revoke-key' => $key['key_id'] ), admin_url( 'admin.php?page=wc-settings&tab=api&section=keys' ) ), 'revoke' ) ) . '">' . __( 'Revoke', 'woocommerce' ) . '</a>'
'trash' => '<a class="submitdelete" title="' . esc_attr__( 'Revoke API Key', 'woocommerce' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'revoke-key' => $key['key_id'] ), admin_url( 'admin.php?page=wc-settings&tab=api&section=keys' ) ), 'revoke' ) ) . '">' . __( 'Revoke', 'woocommerce' ) . '</a>',
);
$row_actions = array();
@ -133,7 +133,7 @@ class WC_Admin_API_Keys_Table_List extends WP_List_Table {
$permissions = array(
'read' => __( 'Read', 'woocommerce' ),
'write' => __( 'Write', 'woocommerce' ),
'read_write' => __( 'Read/Write', 'woocommerce' )
'read_write' => __( 'Read/Write', 'woocommerce' ),
);
if ( isset( $permissions[ $permission_key ] ) ) {
@ -166,7 +166,7 @@ class WC_Admin_API_Keys_Table_List extends WP_List_Table {
*/
protected function get_bulk_actions() {
return array(
'revoke' => __( 'Revoke', 'woocommerce' )
'revoke' => __( 'Revoke', 'woocommerce' ),
);
}
@ -211,7 +211,7 @@ class WC_Admin_API_Keys_Table_List extends WP_List_Table {
$this->set_pagination_args( array(
'total_items' => $count,
'per_page' => $per_page,
'total_pages' => ceil( $count / $per_page )
'total_pages' => ceil( $count / $per_page ),
) );
}
}

View File

@ -87,7 +87,7 @@ class WC_Admin_API_Keys {
'description' => '',
'permissions' => '',
'truncated_key' => '',
'last_access' => ''
'last_access' => '',
);
if ( 0 == $key_id ) {

View File

@ -123,12 +123,12 @@ class WC_Admin_Assets {
'i18n_searching' => _x( 'Searching&hellip;', 'enhanced select', 'woocommerce' ),
'ajax_url' => admin_url( 'admin-ajax.php' ),
'search_products_nonce' => wp_create_nonce( 'search-products' ),
'search_customers_nonce' => wp_create_nonce( 'search-customers' )
'search_customers_nonce' => wp_create_nonce( 'search-customers' ),
) );
// Accounting
wp_localize_script( 'accounting', 'accounting_params', array(
'mon_decimal_point' => wc_get_price_decimal_separator()
'mon_decimal_point' => wc_get_price_decimal_separator(),
) );
// WooCommerce admin pages
@ -148,7 +148,7 @@ class WC_Admin_Assets {
'i18n_country_iso_error' => __( 'Please enter in country code with two capital letters.', 'woocommerce' ),
'i18_sale_less_than_regular_error' => __( 'Please enter in a value less than the regular price.', 'woocommerce' ),
'decimal_point' => $decimal,
'mon_decimal_point' => wc_get_price_decimal_separator()
'mon_decimal_point' => wc_get_price_decimal_separator(),
);
wp_localize_script( 'woocommerce_admin', 'woocommerce_admin', $params );
@ -202,7 +202,7 @@ class WC_Admin_Assets {
'i18n_edited_variations' => esc_js( __( 'Save changes before changing page?', 'woocommerce' ) ),
'i18n_variation_count_single' => esc_js( __( '%qty% variation', 'woocommerce' ) ),
'i18n_variation_count_plural' => esc_js( __( '%qty% variations', 'woocommerce' ) ),
'variations_per_page' => absint( apply_filters( 'woocommerce_admin_meta_boxes_variations_per_page', 15 ) )
'variations_per_page' => absint( apply_filters( 'woocommerce_admin_meta_boxes_variations_per_page', 15 ) ),
);
wp_localize_script( 'wc-admin-variation-meta-boxes', 'woocommerce_admin_meta_boxes_variations', $params );
@ -213,7 +213,7 @@ class WC_Admin_Assets {
$params = array(
'countries' => json_encode( array_merge( WC()->countries->get_allowed_country_states(), WC()->countries->get_shipping_country_states() ) ),
'i18n_select_state_text' => esc_attr__( 'Select an option&hellip;', 'woocommerce' )
'i18n_select_state_text' => esc_attr__( 'Select an option&hellip;', 'woocommerce' ),
);
wp_localize_script( 'wc-admin-order-meta-boxes', 'woocommerce_admin_meta_boxes_order', $params );
@ -284,7 +284,7 @@ class WC_Admin_Assets {
'i18n_permission_revoke' => __( 'Are you sure you want to revoke access to this download?', 'woocommerce' ),
'i18n_tax_rate_already_exists' => __( 'You cannot add the same tax rate twice!', 'woocommerce' ),
'i18n_product_type_alert' => __( 'Your product has variations! Before changing the product type, it is a good idea to delete the variations to avoid errors in the stock reports.', 'woocommerce' ),
'i18n_delete_note' => __( 'Are you sure you wish to delete this note? This action cannot be undone.', 'woocommerce' )
'i18n_delete_note' => __( 'Are you sure you wish to delete this note? This action cannot be undone.', 'woocommerce' ),
);
wp_localize_script( 'wc-admin-meta-boxes', 'woocommerce_admin_meta_boxes', $params );
@ -299,7 +299,7 @@ class WC_Admin_Assets {
$taxonomy = isset( $_GET['taxonomy'] ) ? wc_clean( $_GET['taxonomy'] ) : '';
$woocommerce_term_order_params = array(
'taxonomy' => $taxonomy
'taxonomy' => $taxonomy,
);
wp_localize_script( 'woocommerce_term_ordering', 'woocommerce_term_ordering_params', $woocommerce_term_order_params );

View File

@ -72,7 +72,7 @@ class WC_Admin_Attributes {
'attribute_name' => isset( $_POST['attribute_name'] ) ? wc_sanitize_taxonomy_name( stripslashes( $_POST['attribute_name'] ) ) : '',
'attribute_type' => isset( $_POST['attribute_type'] ) ? wc_clean( $_POST['attribute_type'] ) : 'select',
'attribute_orderby' => isset( $_POST['attribute_orderby'] ) ? wc_clean( $_POST['attribute_orderby'] ) : '',
'attribute_public' => isset( $_POST['attribute_public'] ) ? 1 : 0
'attribute_public' => isset( $_POST['attribute_public'] ) ? 1 : 0,
);
if ( empty( $attribute['attribute_type'] ) ) {

View File

@ -156,7 +156,7 @@ class WC_Admin_Duplicate_Product {
'post_modified_gmt' => $new_post_date_gmt,
'post_parent' => $post_parent,
'menu_order' => $post->menu_order,
'post_mime_type' => $post->post_mime_type
'post_mime_type' => $post->post_mime_type,
)
);
@ -171,7 +171,7 @@ class WC_Admin_Duplicate_Product {
'post_title' => $post_title,
),
array(
'ID' => $new_post_id
'ID' => $new_post_id,
)
);
}
@ -185,7 +185,7 @@ class WC_Admin_Duplicate_Product {
'guid' => get_permalink( $new_post_id ),
),
array(
'ID' => $new_post_id
'ID' => $new_post_id,
)
);
}

View File

@ -39,116 +39,116 @@ class WC_Admin_Help {
$video_map = array(
'wc-settings' => array(
'title' => __( 'General Settings', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/mz2l10u5f6?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/mz2l10u5f6?videoFoam=true',
),
'wc-settings-general' => array(
'title' => __( 'General Settings', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/mz2l10u5f6?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/mz2l10u5f6?videoFoam=true',
),
'wc-settings-products' => array(
'title' => __( 'Product Settings', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/lolkan4fxf?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/lolkan4fxf?videoFoam=true',
),
'wc-settings-tax' => array(
'title' => __( 'Tax Settings', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/qp1v19dwrh?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/qp1v19dwrh?videoFoam=true',
),
'wc-settings-shipping' => array(
'title' => __( 'Shipping Zones', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/95yiocro6p?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/95yiocro6p?videoFoam=true',
),
'wc-settings-shipping-options' => array(
'title' => __( 'Shipping Options', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/9c9008dxnr?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/9c9008dxnr?videoFoam=true',
),
'wc-settings-shipping-classes' => array(
'title' => __( 'Shipping Classes', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/tpqg17aq99?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/tpqg17aq99?videoFoam=true',
),
'wc-settings-checkout' => array(
'title' => __( 'Checkout Settings', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/65yjv96z51?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/65yjv96z51?videoFoam=true',
),
'wc-settings-checkout-bacs' => array(
'title' => __( 'Bank Transfer (BACS) Payments', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/dh4piy3sek?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/dh4piy3sek?videoFoam=true',
),
'wc-settings-checkout-cheque' => array(
'title' => __( 'Check Payments', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/u2m2kcakea?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/u2m2kcakea?videoFoam=true',
),
'wc-settings-checkout-cod' => array(
'title' => __( 'Cash on Delivery', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/8hyli8wu5f?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/8hyli8wu5f?videoFoam=true',
),
'wc-settings-checkout-paypal' => array(
'title' => __( 'PayPal Standard', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/rbl7e7l4k2?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/rbl7e7l4k2?videoFoam=true',
),
'wc-settings-checkout-paypalbraintree_cards' => array(
'title' => __( 'PayPal by Braintree', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/oyksirgn40?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/oyksirgn40?videoFoam=true',
),
'wc-settings-checkout-stripe' => array(
'title' => __( 'Stripe', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/mf975hx5de?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/mf975hx5de?videoFoam=true',
),
'wc-settings-checkout-simplify_commerce' => array(
'title' => __( 'Simplify Commerce', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/jdfzjiiw61?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/jdfzjiiw61?videoFoam=true',
),
'wc-settings-account' => array(
'title' => __( 'Account Settings', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/35mazq7il2?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/35mazq7il2?videoFoam=true',
),
'wc-settings-email' => array(
'title' => __( 'Email Settings', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/svcaftq4xv?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/svcaftq4xv?videoFoam=true',
),
'wc-settings-api' => array(
'title' => __( 'Webhook Settings', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/1q0ny74vvq?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/1q0ny74vvq?videoFoam=true',
),
'product' => array(
'title' => __( 'Simple Products', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/ziyjmd4kut?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/ziyjmd4kut?videoFoam=true',
),
'edit-product_cat' => array(
'title' => __( 'Product Categories', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/f0j5gzqigg?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/f0j5gzqigg?videoFoam=true',
),
'edit-product_tag' => array(
'title' => __( 'Product Categories, Tags, Shipping Classes, &amp; Attributes', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/f0j5gzqigg?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/f0j5gzqigg?videoFoam=true',
),
'product_attributes' => array(
'title' => __( 'Product Categories, Tags, Shipping Classes, &amp; Attributes', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/f0j5gzqigg?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/f0j5gzqigg?videoFoam=true',
),
'wc-status' => array(
'title' => __( 'System Status', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/xdn733nnhi?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/xdn733nnhi?videoFoam=true',
),
'wc-reports' => array(
'title' => __( 'Reports', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/6aasex0w99?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/6aasex0w99?videoFoam=true',
),
'edit-shop_coupon' => array(
'title' => __( 'Coupons', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/gupd4h8sit?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/gupd4h8sit?videoFoam=true',
),
'shop_coupon' => array(
'title' => __( 'Coupons', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/gupd4h8sit?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/gupd4h8sit?videoFoam=true',
),
'edit-shop_order' => array(
'title' => __( 'Managing Orders', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/n8n0sa8hee?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/n8n0sa8hee?videoFoam=true',
),
'shop_order' => array(
'title' => __( 'Managing Orders', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/n8n0sa8hee?videoFoam=true'
)
'url' => '//fast.wistia.net/embed/iframe/n8n0sa8hee?videoFoam=true',
),
);
$page = empty( $_GET['page'] ) ? '' : sanitize_title( $_GET['page'] );
@ -172,7 +172,7 @@ class WC_Admin_Help {
'title' => __( 'WooCommerce 101', 'woocommerce' ),
'content' =>
'<h2><a href="https://docs.woocommerce.com/document/woocommerce-101-video-series/?utm_source=helptab&utm_medium=product&utm_content=videos&utm_campaign=woocommerceplugin">' . __( 'WooCommerce 101', 'woocommerce' ) . '</a> &ndash; ' . esc_html( $video_map[ $video_key ]['title'] ) . '</h2>' .
'<iframe data-src="' . esc_url( $video_map[ $video_key ]['url'] ) . '" src="" allowtransparency="true" frameborder="0" scrolling="no" class="wistia_embed" name="wistia_embed" allowfullscreen mozallowfullscreen webkitallowfullscreen oallowfullscreen msallowfullscreen width="480" height="298"></iframe>'
'<iframe data-src="' . esc_url( $video_map[ $video_key ]['url'] ) . '" src="" allowtransparency="true" frameborder="0" scrolling="no" class="wistia_embed" name="wistia_embed" allowfullscreen mozallowfullscreen webkitallowfullscreen oallowfullscreen msallowfullscreen width="480" height="298"></iframe>',
) );
}
@ -194,7 +194,7 @@ class WC_Admin_Help {
'</a>'
) . '</p>' .
'<p>' . __( 'Before asking for help we recommend checking the system status page to identify any problems with your configuration.', 'woocommerce' ) . '</p>' .
'<p><a href="' . admin_url( 'admin.php?page=wc-status' ) . '" class="button button-primary">' . __( 'System Status', 'woocommerce' ) . '</a> <a href="' . 'https://wordpress.org/support/plugin/woocommerce' . '" class="button">' . __( 'Community Forum', 'woocommerce' ) . '</a> <a href="' . 'https://woocommerce.com/my-account/tickets/?utm_source=helptab&utm_medium=product&utm_content=tickets&utm_campaign=woocommerceplugin' . '" class="button">' . __( 'WooCommerce Helpdesk', 'woocommerce' ) . '</a></p>'
'<p><a href="' . admin_url( 'admin.php?page=wc-status' ) . '" class="button button-primary">' . __( 'System Status', 'woocommerce' ) . '</a> <a href="' . 'https://wordpress.org/support/plugin/woocommerce' . '" class="button">' . __( 'Community Forum', 'woocommerce' ) . '</a> <a href="' . 'https://woocommerce.com/my-account/tickets/?utm_source=helptab&utm_medium=product&utm_content=tickets&utm_campaign=woocommerceplugin' . '" class="button">' . __( 'WooCommerce Helpdesk', 'woocommerce' ) . '</a></p>',
) );
$screen->add_help_tab( array(
@ -203,7 +203,7 @@ class WC_Admin_Help {
'content' =>
'<h2>' . __( 'Found a bug?', 'woocommerce' ) . '</h2>' .
'<p>' . sprintf( __( 'If you find a bug within WooCommerce core you can create a ticket via <a href="%s">Github issues</a>. Ensure you read the <a href="%s">contribution guide</a> prior to submitting your report. To help us solve your issue, please be as descriptive as possible and include your <a href="%s">system status report</a>.', 'woocommerce' ), 'https://github.com/woothemes/woocommerce/issues?state=open', 'https://github.com/woothemes/woocommerce/blob/master/.github/CONTRIBUTING.md', admin_url( 'admin.php?page=wc-status' ) ) . '</p>' .
'<p><a href="' . 'https://github.com/woothemes/woocommerce/issues?state=open' . '" class="button button-primary">' . __( 'Report a bug', 'woocommerce' ) . '</a> <a href="' . admin_url( 'admin.php?page=wc-status' ) . '" class="button">' . __( 'System Status', 'woocommerce' ) . '</a></p>'
'<p><a href="' . 'https://github.com/woothemes/woocommerce/issues?state=open' . '" class="button button-primary">' . __( 'Report a bug', 'woocommerce' ) . '</a> <a href="' . admin_url( 'admin.php?page=wc-status' ) . '" class="button">' . __( 'System Status', 'woocommerce' ) . '</a></p>',
) );
@ -213,7 +213,7 @@ class WC_Admin_Help {
'content' =>
'<h2>' . __( 'Education', 'woocommerce' ) . '</h2>' .
'<p>' . __( 'If you would like to learn about using WooCommerce from an expert, consider following a WooCommerce course offered by one of our educational partners.', 'woocommerce' ) . '</p>' .
'<p><a href="' . 'https://woocommerce.com/educational-partners/?utm_source=helptab&utm_medium=product&utm_content=edupartners&utm_campaign=woocommerceplugin' . '" class="button button-primary">' . __( 'View Education Partners', 'woocommerce' ) . '</a></p>'
'<p><a href="' . 'https://woocommerce.com/educational-partners/?utm_source=helptab&utm_medium=product&utm_content=edupartners&utm_campaign=woocommerceplugin' . '" class="button button-primary">' . __( 'View Education Partners', 'woocommerce' ) . '</a></p>',
) );
$screen->add_help_tab( array(
@ -222,7 +222,7 @@ class WC_Admin_Help {
'content' =>
'<h2>' . __( 'Setup Wizard', 'woocommerce' ) . '</h2>' .
'<p>' . __( 'If you need to access the setup wizard again, please click on the button below.', 'woocommerce' ) . '</p>' .
'<p><a href="' . admin_url( 'index.php?page=wc-setup' ) . '" class="button button-primary">' . __( 'Setup Wizard', 'woocommerce' ) . '</a></p>'
'<p><a href="' . admin_url( 'index.php?page=wc-setup' ) . '" class="button button-primary">' . __( 'Setup Wizard', 'woocommerce' ) . '</a></p>',
) );

View File

@ -94,7 +94,7 @@ class WC_Admin_Importers {
'attribute_name' => $attribute_name,
'attribute_type' => 'select',
'attribute_orderby' => 'menu_order',
'attribute_public' => 0
'attribute_public' => 0,
);
$wpdb->insert( $wpdb->prefix . 'woocommerce_attribute_taxonomies', $attribute );
delete_transient( 'wc_attribute_taxonomies' );

View File

@ -325,7 +325,7 @@ class WC_Admin_Menus {
'parent' => 'site-name',
'id' => 'view-store',
'title' => __( 'Visit Store', 'woocommerce' ),
'href' => wc_get_page_permalink( 'shop' )
'href' => wc_get_page_permalink( 'shop' ),
) );
}
}

View File

@ -106,7 +106,7 @@ class WC_Admin_Permalink_Settings {
$structures = array(
0 => '',
1 => '/' . trailingslashit( $base_slug ),
2 => '/' . trailingslashit( $base_slug ) . trailingslashit( '%product_cat%' )
2 => '/' . trailingslashit( $base_slug ) . trailingslashit( '%product_cat%' ),
);
?>
<table class="form-table wc-permalink-structure">

View File

@ -54,16 +54,16 @@ class WC_Admin_Pointers {
'next' => 'content',
'next_trigger' => array(
'target' => '#title',
'event' => 'input'
'event' => 'input',
),
'options' => array(
'content' => '<h3>' . esc_html__( 'Product Name', 'woocommerce' ) . '</h3>' .
'<p>' . esc_html__( 'Give your new product a name here. This is a required field and will be what your customers will see in your store.', 'woocommerce' ) . '</p>',
'position' => array(
'edge' => 'top',
'align' => 'left'
)
)
'align' => 'left',
),
),
),
'content' => array(
'target' => "#wp-content-editor-container",
@ -74,16 +74,16 @@ class WC_Admin_Pointers {
'<p>' . esc_html__( 'This is your products main body of content. Here you should describe your product in detail.', 'woocommerce' ) . '</p>',
'position' => array(
'edge' => 'bottom',
'align' => 'middle'
)
)
'align' => 'middle',
),
),
),
'product-type' => array(
'target' => "#product-type",
'next' => 'virtual',
'next_trigger' => array(
'target' => "#product-type",
'event' => 'change blur click'
'event' => 'change blur click',
),
'options' => array(
'content' => '<h3>' . esc_html__( 'Choose Product Type', 'woocommerce' ) . '</h3>' .
@ -93,73 +93,73 @@ class WC_Admin_Pointers {
'<p>' . esc_html__( 'Finally, external products are for linking off-site.', 'woocommerce' ) . '</p>',
'position' => array(
'edge' => 'bottom',
'align' => 'middle'
)
)
'align' => 'middle',
),
),
),
'virtual' => array(
'target' => "#_virtual",
'next' => 'downloadable',
'next_trigger' => array(
'target' => "#_virtual",
'event' => 'change'
'event' => 'change',
),
'options' => array(
'content' => '<h3>' . esc_html__( 'Virtual Products', 'woocommerce' ) . '</h3>' .
'<p>' . esc_html__( 'Check the "Virtual" box if this is a non-physical item, for example a service, which does not need shipping.', 'woocommerce' ) . '</p>',
'position' => array(
'edge' => 'bottom',
'align' => 'middle'
)
)
'align' => 'middle',
),
),
),
'downloadable' => array(
'target' => "#_downloadable",
'next' => 'regular_price',
'next_trigger' => array(
'target' => "#_downloadable",
'event' => 'change'
'event' => 'change',
),
'options' => array(
'content' => '<h3>' . esc_html__( 'Downloadable Products', 'woocommerce' ) . '</h3>' .
'<p>' . esc_html__( 'If purchasing this product gives a customer access to a downloadable file, e.g. software, check this box.', 'woocommerce' ) . '</p>',
'position' => array(
'edge' => 'bottom',
'align' => 'middle'
)
)
'align' => 'middle',
),
),
),
'regular_price' => array(
'target' => "#_regular_price",
'next' => 'postexcerpt',
'next_trigger' => array(
'target' => "#_regular_price",
'event' => 'input'
'event' => 'input',
),
'options' => array(
'content' => '<h3>' . esc_html__( 'Prices', 'woocommerce' ) . '</h3>' .
'<p>' . esc_html__( 'Next you\'ll need to give your product a price.', 'woocommerce' ) . '</p>',
'position' => array(
'edge' => 'bottom',
'align' => 'middle'
)
)
'align' => 'middle',
),
),
),
'postexcerpt' => array(
'target' => "#postexcerpt",
'next' => 'postimagediv',
'next_trigger' => array(
'target' => "#postexcerpt",
'event' => 'input'
'event' => 'input',
),
'options' => array(
'content' => '<h3>' . esc_html__( 'Product Short Description', 'woocommerce' ) . '</h3>' .
'<p>' . esc_html__( 'Add a quick summary for your product here. This will appear on the product page under the product name.', 'woocommerce' ) . '</p>',
'position' => array(
'edge' => 'bottom',
'align' => 'middle'
)
)
'align' => 'middle',
),
),
),
'postimagediv' => array(
'target' => "#postimagediv",
@ -169,9 +169,9 @@ class WC_Admin_Pointers {
'<p>' . esc_html__( 'Upload or assign an image to your product here. This image will be shown in your store\'s catalog.', 'woocommerce' ) . '</p>',
'position' => array(
'edge' => 'right',
'align' => 'middle'
)
)
'align' => 'middle',
),
),
),
'product_tag' => array(
'target' => "#tagsdiv-product_tag",
@ -181,9 +181,9 @@ class WC_Admin_Pointers {
'<p>' . esc_html__( 'You can optionally "tag" your products here. Tags as a method of labeling your products to make them easier for customers to find.', 'woocommerce' ) . '</p>',
'position' => array(
'edge' => 'right',
'align' => 'middle'
)
)
'align' => 'middle',
),
),
),
'product_catdiv' => array(
'target' => "#product_catdiv",
@ -193,9 +193,9 @@ class WC_Admin_Pointers {
'<p>' . esc_html__( 'Optionally assign categories to your products to make them easier to browse through and find in your store.', 'woocommerce' ) . '</p>',
'position' => array(
'edge' => 'right',
'align' => 'middle'
)
)
'align' => 'middle',
),
),
),
'submitdiv' => array(
'target' => "#submitdiv",
@ -205,11 +205,11 @@ class WC_Admin_Pointers {
'<p>' . esc_html__( 'When you are finished editing your product, hit the "Publish" button to publish your product to your store.', 'woocommerce' ) . '</p>',
'position' => array(
'edge' => 'right',
'align' => 'middle'
)
)
)
)
'align' => 'middle',
),
),
),
),
);
$this->enqueue_pointers( $pointers );

View File

@ -150,7 +150,7 @@ class WC_Admin_Post_Types {
9 => sprintf( __( 'Order scheduled for: <strong>%1$s</strong>.', 'woocommerce' ),
date_i18n( __( 'M j, Y @ G:i', 'woocommerce' ), strtotime( $post->post_date ) ) ),
10 => __( 'Order draft updated.', 'woocommerce' ),
11 => __( 'Order updated and email sent.', 'woocommerce' )
11 => __( 'Order updated and email sent.', 'woocommerce' ),
);
$messages['shop_coupon'] = array(
@ -165,7 +165,7 @@ class WC_Admin_Post_Types {
8 => __( 'Coupon submitted.', 'woocommerce' ),
9 => sprintf( __( 'Coupon scheduled for: <strong>%1$s</strong>.', 'woocommerce' ),
date_i18n( __( 'M j, Y @ G:i', 'woocommerce' ), strtotime( $post->post_date ) ) ),
10 => __( 'Coupon draft updated.', 'woocommerce' )
10 => __( 'Coupon draft updated.', 'woocommerce' ),
);
return $messages;
@ -706,7 +706,7 @@ class WC_Admin_Post_Types {
$latest_notes = get_comments( array(
'post_id' => $post->ID,
'number' => 1,
'status' => $status
'status' => $status,
) );
$latest_note = current( $latest_notes );
@ -780,7 +780,7 @@ class WC_Admin_Post_Types {
$actions['processing'] = array(
'url' => wp_nonce_url( admin_url( 'admin-ajax.php?action=woocommerce_mark_order_status&status=processing&order_id=' . $post->ID ), 'woocommerce-mark-order-status' ),
'name' => __( 'Processing', 'woocommerce' ),
'action' => "processing"
'action' => "processing",
);
}
@ -788,14 +788,14 @@ class WC_Admin_Post_Types {
$actions['complete'] = array(
'url' => wp_nonce_url( admin_url( 'admin-ajax.php?action=woocommerce_mark_order_status&status=completed&order_id=' . $post->ID ), 'woocommerce-mark-order-status' ),
'name' => __( 'Complete', 'woocommerce' ),
'action' => "complete"
'action' => "complete",
);
}
$actions['view'] = array(
'url' => admin_url( 'post.php?post=' . $post->ID . '&action=edit' ),
'name' => __( 'View', 'woocommerce' ),
'action' => "view"
'action' => "view",
);
$actions = apply_filters( 'woocommerce_admin_order_actions', $actions, $the_order );
@ -823,7 +823,7 @@ class WC_Admin_Post_Types {
'price' => 'price',
'featured' => array( 'featured', 1 ),
'sku' => 'sku',
'name' => 'title'
'name' => 'title',
);
return wp_parse_args( $custom, $columns );
}
@ -848,7 +848,7 @@ class WC_Admin_Post_Types {
$custom = array(
'order_title' => 'ID',
'order_total' => 'order_total',
'order_date' => 'date'
'order_date' => 'date',
);
unset( $columns['comments'] );
@ -1703,19 +1703,19 @@ class WC_Admin_Post_Types {
if ( 'price' == $vars['orderby'] ) {
$vars = array_merge( $vars, array(
'meta_key' => '_price',
'orderby' => 'meta_value_num'
'orderby' => 'meta_value_num',
) );
}
if ( 'featured' == $vars['orderby'] ) {
$vars = array_merge( $vars, array(
'meta_key' => '_featured',
'orderby' => 'meta_value'
'orderby' => 'meta_value',
) );
}
if ( 'sku' == $vars['orderby'] ) {
$vars = array_merge( $vars, array(
'meta_key' => '_sku',
'orderby' => 'meta_value'
'orderby' => 'meta_value',
) );
}
}
@ -1735,7 +1735,7 @@ class WC_Admin_Post_Types {
array(
'key' => '_customer_user',
'value' => (int) $_GET['_customer_user'],
'compare' => '='
'compare' => '=',
)
);
}
@ -1745,7 +1745,7 @@ class WC_Admin_Post_Types {
if ( 'order_total' == $vars['orderby'] ) {
$vars = array_merge( $vars, array(
'meta_key' => '_order_total',
'orderby' => 'meta_value_num'
'orderby' => 'meta_value_num',
) );
}
}
@ -1798,7 +1798,7 @@ class WC_Admin_Post_Types {
'taxonomy' => 'product_cat',
'field' => 'id',
'terms' => get_terms( 'product_cat', array( 'fields' => 'ids' ) ),
'operator' => 'NOT IN'
'operator' => 'NOT IN',
);
}
@ -1808,7 +1808,7 @@ class WC_Admin_Post_Types {
'taxonomy' => 'product_shipping_class',
'field' => 'id',
'terms' => get_terms( 'product_shipping_class', array( 'fields' => 'ids' ) ),
'operator' => 'NOT IN'
'operator' => 'NOT IN',
);
}
}
@ -2101,7 +2101,7 @@ class WC_Admin_Post_Types {
'visible' => __( 'Catalog/search', 'woocommerce' ),
'catalog' => __( 'Catalog', 'woocommerce' ),
'search' => __( 'Search', 'woocommerce' ),
'hidden' => __( 'Hidden', 'woocommerce' )
'hidden' => __( 'Hidden', 'woocommerce' ),
) );
?>
<div class="misc-pub-section" id="catalog-visibility">

View File

@ -42,99 +42,99 @@ class WC_Admin_Profile {
'fields' => array(
'billing_first_name' => array(
'label' => __( 'First name', 'woocommerce' ),
'description' => ''
'description' => '',
),
'billing_last_name' => array(
'label' => __( 'Last name', 'woocommerce' ),
'description' => ''
'description' => '',
),
'billing_company' => array(
'label' => __( 'Company', 'woocommerce' ),
'description' => ''
'description' => '',
),
'billing_address_1' => array(
'label' => __( 'Address 1', 'woocommerce' ),
'description' => ''
'description' => '',
),
'billing_address_2' => array(
'label' => __( 'Address 2', 'woocommerce' ),
'description' => ''
'description' => '',
),
'billing_city' => array(
'label' => __( 'City', 'woocommerce' ),
'description' => ''
'description' => '',
),
'billing_postcode' => array(
'label' => __( 'Postcode', 'woocommerce' ),
'description' => ''
'description' => '',
),
'billing_country' => array(
'label' => __( 'Country', 'woocommerce' ),
'description' => '',
'class' => 'js_field-country',
'type' => 'select',
'options' => array( '' => __( 'Select a country&hellip;', 'woocommerce' ) ) + WC()->countries->get_allowed_countries()
'options' => array( '' => __( 'Select a country&hellip;', 'woocommerce' ) ) + WC()->countries->get_allowed_countries(),
),
'billing_state' => array(
'label' => __( 'State/County', 'woocommerce' ),
'description' => __( 'State/County or state code', 'woocommerce' ),
'class' => 'js_field-state'
'class' => 'js_field-state',
),
'billing_phone' => array(
'label' => __( 'Telephone', 'woocommerce' ),
'description' => ''
'description' => '',
),
'billing_email' => array(
'label' => __( 'Email', 'woocommerce' ),
'description' => ''
)
)
'description' => '',
),
),
),
'shipping' => array(
'title' => __( 'Customer Shipping Address', 'woocommerce' ),
'fields' => array(
'shipping_first_name' => array(
'label' => __( 'First name', 'woocommerce' ),
'description' => ''
'description' => '',
),
'shipping_last_name' => array(
'label' => __( 'Last name', 'woocommerce' ),
'description' => ''
'description' => '',
),
'shipping_company' => array(
'label' => __( 'Company', 'woocommerce' ),
'description' => ''
'description' => '',
),
'shipping_address_1' => array(
'label' => __( 'Address 1', 'woocommerce' ),
'description' => ''
'description' => '',
),
'shipping_address_2' => array(
'label' => __( 'Address 2', 'woocommerce' ),
'description' => ''
'description' => '',
),
'shipping_city' => array(
'label' => __( 'City', 'woocommerce' ),
'description' => ''
'description' => '',
),
'shipping_postcode' => array(
'label' => __( 'Postcode', 'woocommerce' ),
'description' => ''
'description' => '',
),
'shipping_country' => array(
'label' => __( 'Country', 'woocommerce' ),
'description' => '',
'class' => 'js_field-country',
'type' => 'select',
'options' => array( '' => __( 'Select a country&hellip;', 'woocommerce' ) ) + WC()->countries->get_allowed_countries()
'options' => array( '' => __( 'Select a country&hellip;', 'woocommerce' ) ) + WC()->countries->get_allowed_countries(),
),
'shipping_state' => array(
'label' => __( 'State/County', 'woocommerce' ),
'description' => __( 'State/County or state code', 'woocommerce' ),
'class' => 'js_field-state'
)
)
)
'class' => 'js_field-state',
),
),
),
) );
return $show_fields;
}

View File

@ -48,27 +48,27 @@ class WC_Admin_Reports {
'title' => __( 'Sales by date', 'woocommerce' ),
'description' => '',
'hide_title' => true,
'callback' => array( __CLASS__, 'get_report' )
'callback' => array( __CLASS__, 'get_report' ),
),
"sales_by_product" => array(
'title' => __( 'Sales by product', 'woocommerce' ),
'description' => '',
'hide_title' => true,
'callback' => array( __CLASS__, 'get_report' )
'callback' => array( __CLASS__, 'get_report' ),
),
"sales_by_category" => array(
'title' => __( 'Sales by category', 'woocommerce' ),
'description' => '',
'hide_title' => true,
'callback' => array( __CLASS__, 'get_report' )
'callback' => array( __CLASS__, 'get_report' ),
),
"coupon_usage" => array(
'title' => __( 'Coupons by date', 'woocommerce' ),
'description' => '',
'hide_title' => true,
'callback' => array( __CLASS__, 'get_report' )
)
)
'callback' => array( __CLASS__, 'get_report' ),
),
),
),
'customers' => array(
'title' => __( 'Customers', 'woocommerce' ),
@ -77,15 +77,15 @@ class WC_Admin_Reports {
'title' => __( 'Customers vs. Guests', 'woocommerce' ),
'description' => '',
'hide_title' => true,
'callback' => array( __CLASS__, 'get_report' )
'callback' => array( __CLASS__, 'get_report' ),
),
"customer_list" => array(
'title' => __( 'Customer List', 'woocommerce' ),
'description' => '',
'hide_title' => true,
'callback' => array( __CLASS__, 'get_report' )
'callback' => array( __CLASS__, 'get_report' ),
),
)
),
),
'stock' => array(
'title' => __( 'Stock', 'woocommerce' ),
@ -94,22 +94,22 @@ class WC_Admin_Reports {
'title' => __( 'Low in stock', 'woocommerce' ),
'description' => '',
'hide_title' => true,
'callback' => array( __CLASS__, 'get_report' )
'callback' => array( __CLASS__, 'get_report' ),
),
"out_of_stock" => array(
'title' => __( 'Out of stock', 'woocommerce' ),
'description' => '',
'hide_title' => true,
'callback' => array( __CLASS__, 'get_report' )
'callback' => array( __CLASS__, 'get_report' ),
),
"most_stocked" => array(
'title' => __( 'Most Stocked', 'woocommerce' ),
'description' => '',
'hide_title' => true,
'callback' => array( __CLASS__, 'get_report' )
'callback' => array( __CLASS__, 'get_report' ),
),
)
)
),
),
);
if ( wc_tax_enabled() ) {
@ -120,15 +120,15 @@ class WC_Admin_Reports {
'title' => __( 'Taxes by code', 'woocommerce' ),
'description' => '',
'hide_title' => true,
'callback' => array( __CLASS__, 'get_report' )
'callback' => array( __CLASS__, 'get_report' ),
),
"taxes_by_date" => array(
'title' => __( 'Taxes by date', 'woocommerce' ),
'description' => '',
'hide_title' => true,
'callback' => array( __CLASS__, 'get_report' )
'callback' => array( __CLASS__, 'get_report' ),
),
)
),
);
}

View File

@ -139,7 +139,7 @@ class WC_Admin_Settings {
wp_enqueue_script( 'woocommerce_settings', WC()->plugin_url() . '/assets/js/admin/settings' . $suffix . '.js', array( 'jquery', 'jquery-ui-datepicker', 'jquery-ui-sortable', 'iris', 'select2' ), WC()->version, true );
wp_localize_script( 'woocommerce_settings', 'woocommerce_settings_params', array(
'i18n_nav_warning' => __( 'The changes you made will be lost if you navigate away from this page.', 'woocommerce' )
'i18n_nav_warning' => __( 'The changes you made will be lost if you navigate away from this page.', 'woocommerce' ),
) );
// Include settings pages
@ -537,7 +537,7 @@ class WC_Admin_Settings {
'show_option_none' => ' ',
'class' => $value['class'],
'echo' => false,
'selected' => absint( self::get_option( $value['id'] ) )
'selected' => absint( self::get_option( $value['id'] ) ),
);
if ( isset( $value['args'] ) ) {
@ -652,7 +652,7 @@ class WC_Admin_Settings {
return array(
'description' => $description,
'tooltip_html' => $tooltip_html
'tooltip_html' => $tooltip_html,
);
}

View File

@ -58,17 +58,17 @@ class WC_Admin_Setup_Wizard {
'introduction' => array(
'name' => __( 'Introduction', 'woocommerce' ),
'view' => array( $this, 'wc_setup_introduction' ),
'handler' => ''
'handler' => '',
),
'pages' => array(
'name' => __( 'Page Setup', 'woocommerce' ),
'view' => array( $this, 'wc_setup_pages' ),
'handler' => array( $this, 'wc_setup_pages_save' )
'handler' => array( $this, 'wc_setup_pages_save' ),
),
'locale' => array(
'name' => __( 'Store Locale', 'woocommerce' ),
'view' => array( $this, 'wc_setup_locale' ),
'handler' => array( $this, 'wc_setup_locale_save' )
'handler' => array( $this, 'wc_setup_locale_save' ),
),
'shipping_taxes' => array(
'name' => __( 'Shipping &amp; Tax', 'woocommerce' ),
@ -83,8 +83,8 @@ class WC_Admin_Setup_Wizard {
'next_steps' => array(
'name' => __( 'Ready!', 'woocommerce' ),
'view' => array( $this, 'wc_setup_ready' ),
'handler' => ''
)
'handler' => '',
),
);
$this->step = isset( $_GET['step'] ) ? sanitize_key( $_GET['step'] ) : current( array_keys( $this->steps ) );
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
@ -107,14 +107,14 @@ class WC_Admin_Setup_Wizard {
'i18n_searching' => _x( 'Searching&hellip;', 'enhanced select', 'woocommerce' ),
'ajax_url' => admin_url( 'admin-ajax.php' ),
'search_products_nonce' => wp_create_nonce( 'search-products' ),
'search_customers_nonce' => wp_create_nonce( 'search-customers' )
'search_customers_nonce' => wp_create_nonce( 'search-customers' ),
) );
wp_enqueue_style( 'woocommerce_admin_styles', WC()->plugin_url() . '/assets/css/admin.css', array(), WC_VERSION );
wp_enqueue_style( 'wc-setup', WC()->plugin_url() . '/assets/css/wc-setup.css', array( 'dashicons', 'install' ), WC_VERSION );
wp_register_script( 'wc-setup', WC()->plugin_url() . '/assets/js/admin/wc-setup.min.js', array( 'jquery', 'wc-enhanced-select', 'jquery-blockui' ), WC_VERSION );
wp_localize_script( 'wc-setup', 'wc_setup_params', array(
'locale_info' => json_encode( include( WC()->plugin_path() . '/i18n/locale-info.php' ) )
'locale_info' => json_encode( include( WC()->plugin_path() . '/i18n/locale-info.php' ) ),
) );
if ( ! empty( $_POST['save_step'] ) && isset( $this->steps[ $this->step ]['handler'] ) ) {
@ -546,7 +546,7 @@ class WC_Admin_Setup_Wizard {
'tax_rate_compound' => 0,
'tax_rate_shipping' => $rate['shipping'] ? 1 : 0,
'tax_rate_order' => $loop ++,
'tax_rate_class' => ''
'tax_rate_class' => '',
);
WC_Tax::_insert_tax_rate( $tax_rate );
}
@ -615,7 +615,7 @@ class WC_Admin_Setup_Wizard {
'description' => __( 'A simple offline gateway that lets you accept cash on delivery.', 'woocommerce' ),
'image' => '',
'class' => '',
)
),
);
$country = WC()->countries->get_base_country();

View File

@ -202,7 +202,7 @@ class WC_Admin_Status {
'fields' => array(
'sections' => false,
'tags' => false,
)
),
) );
$update_theme_version = 0;

View File

@ -25,7 +25,7 @@ class WC_Admin_Webhooks_Table_List extends WP_List_Table {
parent::__construct( array(
'singular' => __( 'webhook', 'woocommerce' ),
'plural' => __( 'webhooks', 'woocommerce' ),
'ajax' => false
'ajax' => false,
) );
}
@ -92,7 +92,7 @@ class WC_Admin_Webhooks_Table_List extends WP_List_Table {
// Get actions
$actions = array(
'id' => sprintf( __( 'ID: %d', 'woocommerce' ), $the_webhook->id )
'id' => sprintf( __( 'ID: %d', 'woocommerce' ), $the_webhook->id ),
);
if ( current_user_can( $post_type_object->cap->edit_post, $the_webhook->id ) && 'trash' !== $post_status ) {
@ -244,12 +244,12 @@ class WC_Admin_Webhooks_Table_List extends WP_List_Table {
if ( isset( $_GET['status'] ) && 'trash' == $_GET['status'] ) {
return array(
'untrash' => __( 'Restore', 'woocommerce' ),
'delete' => __( 'Delete Permanently', 'woocommerce' )
'delete' => __( 'Delete Permanently', 'woocommerce' ),
);
}
return array(
'trash' => __( 'Move to Trash', 'woocommerce' )
'trash' => __( 'Move to Trash', 'woocommerce' ),
);
}
@ -283,7 +283,7 @@ class WC_Admin_Webhooks_Table_List extends WP_List_Table {
'post_type' => 'shop_webhook',
'posts_per_page' => $per_page,
'ignore_sticky_posts' => true,
'paged' => $current_page
'paged' => $current_page,
);
// Handle the status query
@ -303,7 +303,7 @@ class WC_Admin_Webhooks_Table_List extends WP_List_Table {
$this->set_pagination_args( array(
'total_items' => $webhooks->found_posts,
'per_page' => $per_page,
'total_pages' => $webhooks->max_num_pages
'total_pages' => $webhooks->max_num_pages,
) );
}
}

View File

@ -196,7 +196,7 @@ class WC_Admin_Webhooks {
'post_author' => get_current_user_id(),
'post_password' => strlen( ( $password = uniqid( 'webhook_' ) ) ) > 20 ? substr( $password, 0, 20 ) : $password,
'post_title' => sprintf( __( 'Webhook created on %s', 'woocommerce' ), strftime( _x( '%b %d, %Y @ %I:%M %p', 'Webhook created on date parsed by strftime', 'woocommerce' ) ) ),
'comment_status' => 'open'
'comment_status' => 'open',
) );
if ( is_wp_error( $webhook_id ) ) {
@ -303,7 +303,7 @@ class WC_Admin_Webhooks {
'ignore_sticky_posts' => true,
'nopaging' => true,
'post_status' => 'trash',
'fields' => 'ids'
'fields' => 'ids',
) );
foreach ( $webhooks as $webhook_id ) {
@ -428,7 +428,7 @@ class WC_Admin_Webhooks {
'post_id' => $webhook->id,
'status' => 'approve',
'type' => 'webhook_delivery',
'number' => 10
'number' => 10,
);
if ( 1 < $current ) {
@ -471,7 +471,7 @@ class WC_Admin_Webhooks {
return array(
'topic' => $topic,
'event' => $event,
'resource' => $resource
'resource' => $resource,
);
}

View File

@ -148,7 +148,7 @@ class WC_Tax_Rate_Importer extends WP_Importer {
'tax_rate_compound' => $compound ? 1 : 0,
'tax_rate_shipping' => $shipping ? 1 : 0,
'tax_rate_order' => $loop ++,
'tax_rate_class' => $class
'tax_rate_class' => $class,
);
$tax_rate_id = WC_Tax::_insert_tax_rate( $tax_rate );

View File

@ -51,7 +51,7 @@ class WC_Meta_Box_Coupon_Data {
'label' => __( 'Usage Limits', 'woocommerce' ),
'target' => 'usage_limit_coupon_data',
'class' => '',
)
),
) );
foreach ( $coupon_data_tabs as $key => $tab ) {
@ -168,7 +168,7 @@ class WC_Meta_Box_Coupon_Data {
// Customers
woocommerce_wp_text_input( array( 'id' => 'customer_email', 'label' => __( 'Email restrictions', 'woocommerce' ), 'placeholder' => __( 'No restrictions', 'woocommerce' ), 'description' => __( 'List of allowed emails to check against the customer\'s billing email when an order is placed. Separate email addresses with commas.', 'woocommerce' ), 'value' => implode(', ', (array) get_post_meta( $post->ID, 'customer_email', true ) ), 'desc_tip' => true, 'type' => 'email', 'class' => '', 'custom_attributes' => array(
'multiple' => 'multiple'
'multiple' => 'multiple',
) ) );
echo '</div>';
@ -183,19 +183,19 @@ class WC_Meta_Box_Coupon_Data {
// Usage limit per coupons
woocommerce_wp_text_input( array( 'id' => 'usage_limit', 'label' => __( 'Usage limit per coupon', 'woocommerce' ), 'placeholder' => _x('Unlimited usage', 'placeholder', 'woocommerce'), 'description' => __( 'How many times this coupon can be used before it is void.', 'woocommerce' ), 'type' => 'number', 'desc_tip' => true, 'class' => 'short', 'custom_attributes' => array(
'step' => '1',
'min' => '0'
'min' => '0',
) ) );
// Usage limit per product
woocommerce_wp_text_input( array( 'id' => 'limit_usage_to_x_items', 'label' => __( 'Limit usage to X items', 'woocommerce' ), 'placeholder' => _x( 'Apply to all qualifying items in cart', 'placeholder', 'woocommerce' ), 'description' => __( 'The maximum number of individual items this coupon can apply to when using product discounts. Leave blank to apply to all qualifying items in cart.', 'woocommerce' ), 'desc_tip' => true, 'class' => 'short', 'type' => 'number', 'custom_attributes' => array(
'step' => '1',
'min' => '0'
'min' => '0',
) ) );
// Usage limit per users
woocommerce_wp_text_input( array( 'id' => 'usage_limit_per_user', 'label' => __( 'Usage limit per user', 'woocommerce' ), 'placeholder' => _x( 'Unlimited usage', 'placeholder', 'woocommerce' ), 'description' => __( 'How many times this coupon can be used by an invidual user. Uses billing email for guests, and user ID for logged in users.', 'woocommerce' ), 'desc_tip' => true, 'class' => 'short', 'type' => 'number', 'custom_attributes' => array(
'step' => '1',
'min' => '0'
'min' => '0',
) ) );
echo '</div>';

View File

@ -41,43 +41,43 @@ class WC_Meta_Box_Order_Data {
self::$billing_fields = apply_filters( 'woocommerce_admin_billing_fields', array(
'first_name' => array(
'label' => __( 'First Name', 'woocommerce' ),
'show' => false
'show' => false,
),
'last_name' => array(
'label' => __( 'Last Name', 'woocommerce' ),
'show' => false
'show' => false,
),
'company' => array(
'label' => __( 'Company', 'woocommerce' ),
'show' => false
'show' => false,
),
'address_1' => array(
'label' => __( 'Address 1', 'woocommerce' ),
'show' => false
'show' => false,
),
'address_2' => array(
'label' => __( 'Address 2', 'woocommerce' ),
'show' => false
'show' => false,
),
'city' => array(
'label' => __( 'City', 'woocommerce' ),
'show' => false
'show' => false,
),
'postcode' => array(
'label' => __( 'Postcode', 'woocommerce' ),
'show' => false
'show' => false,
),
'country' => array(
'label' => __( 'Country', 'woocommerce' ),
'show' => false,
'class' => 'js_field-country select short',
'type' => 'select',
'options' => array( '' => __( 'Select a country&hellip;', 'woocommerce' ) ) + WC()->countries->get_allowed_countries()
'options' => array( '' => __( 'Select a country&hellip;', 'woocommerce' ) ) + WC()->countries->get_allowed_countries(),
),
'state' => array(
'label' => __( 'State/County', 'woocommerce' ),
'class' => 'js_field-state select short',
'show' => false
'show' => false,
),
'email' => array(
'label' => __( 'Email', 'woocommerce' ),
@ -90,43 +90,43 @@ class WC_Meta_Box_Order_Data {
self::$shipping_fields = apply_filters( 'woocommerce_admin_shipping_fields', array(
'first_name' => array(
'label' => __( 'First Name', 'woocommerce' ),
'show' => false
'show' => false,
),
'last_name' => array(
'label' => __( 'Last Name', 'woocommerce' ),
'show' => false
'show' => false,
),
'company' => array(
'label' => __( 'Company', 'woocommerce' ),
'show' => false
'show' => false,
),
'address_1' => array(
'label' => __( 'Address 1', 'woocommerce' ),
'show' => false
'show' => false,
),
'address_2' => array(
'label' => __( 'Address 2', 'woocommerce' ),
'show' => false
'show' => false,
),
'city' => array(
'label' => __( 'City', 'woocommerce' ),
'show' => false
'show' => false,
),
'postcode' => array(
'label' => __( 'Postcode', 'woocommerce' ),
'show' => false
'show' => false,
),
'country' => array(
'label' => __( 'Country', 'woocommerce' ),
'show' => false,
'type' => 'select',
'class' => 'js_field-country select short',
'options' => array( '' => __( 'Select a country&hellip;', 'woocommerce' ) ) + WC()->countries->get_shipping_countries()
'options' => array( '' => __( 'Select a country&hellip;', 'woocommerce' ) ) + WC()->countries->get_shipping_countries(),
),
'state' => array(
'label' => __( 'State/County', 'woocommerce' ),
'class' => 'js_field-state select short',
'show' => false
'show' => false,
),
) );
}
@ -222,7 +222,7 @@ class WC_Meta_Box_Order_Data {
if ( $order->get_user_id() ) {
$args = array( 'post_status' => 'all',
'post_type' => 'shop_order',
'_customer_user' => absint( $order->get_user_id() )
'_customer_user' => absint( $order->get_user_id() ),
);
printf( '<a href="%s">%s &rarr;</a>',
esc_url( add_query_arg( $args, admin_url( 'edit.php' ) ) ),

View File

@ -121,7 +121,7 @@ class WC_Meta_Box_Order_Downloads {
array(
'order_id' => $post_id,
'product_id' => absint( $product_ids[ $i ] ),
'download_id' => wc_clean( $download_ids[ $i ] )
'download_id' => wc_clean( $download_ids[ $i ] ),
),
$format, array( '%d', '%d', '%s' )
);

View File

@ -30,7 +30,7 @@ class WC_Meta_Box_Order_Notes {
'orderby' => 'comment_ID',
'order' => 'DESC',
'approve' => 'approve',
'type' => 'order_note'
'type' => 'order_note',
);
remove_filter( 'comments_clauses', array( 'WC_Comments', 'exclude_order_comments' ), 10, 1 );

View File

@ -51,15 +51,15 @@ class WC_Meta_Box_Product_Data {
'wrapper_class' => 'show_if_simple',
'label' => __( 'Virtual', 'woocommerce' ),
'description' => __( 'Virtual products are intangible and aren\'t shipped.', 'woocommerce' ),
'default' => 'no'
'default' => 'no',
),
'downloadable' => array(
'id' => '_downloadable',
'wrapper_class' => 'show_if_simple',
'label' => __( 'Downloadable', 'woocommerce' ),
'description' => __( 'Downloadable products give access to a file upon purchase.', 'woocommerce' ),
'default' => 'no'
)
'default' => 'no',
),
) );
foreach ( $product_type_options as $key => $option ) {
@ -114,7 +114,7 @@ class WC_Meta_Box_Product_Data {
'label' => __( 'Advanced', 'woocommerce' ),
'target' => 'advanced_product_data',
'class' => array(),
)
),
) );
foreach ( $product_data_tabs as $key => $tab ) {
@ -192,7 +192,7 @@ class WC_Meta_Box_Product_Data {
<a href="#" class="button insert" data-row="<?php
$file = array(
'file' => '',
'name' => ''
'name' => '',
);
ob_start();
include( 'views/html-product-download.php' );
@ -208,13 +208,13 @@ class WC_Meta_Box_Product_Data {
// Download Limit
woocommerce_wp_text_input( array( 'id' => '_download_limit', 'label' => __( 'Download limit', 'woocommerce' ), 'placeholder' => __( 'Unlimited', 'woocommerce' ), 'description' => __( 'Leave blank for unlimited re-downloads.', 'woocommerce' ), 'type' => 'number', 'custom_attributes' => array(
'step' => '1',
'min' => '0'
'min' => '0',
) ) );
// Expirey
woocommerce_wp_text_input( array( 'id' => '_download_expiry', 'label' => __( 'Download expiry', 'woocommerce' ), 'placeholder' => __( 'Never', 'woocommerce' ), 'description' => __( 'Enter the number of days before a download link expires, or leave blank.', 'woocommerce' ), 'type' => 'number', 'custom_attributes' => array(
'step' => '1',
'min' => '0'
'min' => '0',
) ) );
// Download Type
@ -239,10 +239,10 @@ class WC_Meta_Box_Product_Data {
'options' => array(
'taxable' => __( 'Taxable', 'woocommerce' ),
'shipping' => __( 'Shipping only', 'woocommerce' ),
'none' => _x( 'None', 'Tax status', 'woocommerce' )
'none' => _x( 'None', 'Tax status', 'woocommerce' ),
),
'desc_tip' => 'true',
'description' => __( 'Define whether or not the entire product is taxable, or just the cost of shipping it.', 'woocommerce' )
'description' => __( 'Define whether or not the entire product is taxable, or just the cost of shipping it.', 'woocommerce' ),
) );
$tax_classes = WC_Tax::get_tax_classes();
@ -260,7 +260,7 @@ class WC_Meta_Box_Product_Data {
'label' => __( 'Tax class', 'woocommerce' ),
'options' => $classes_options,
'desc_tip' => 'true',
'description' => __( 'Choose a tax class for this product. Tax classes are used to apply different tax rates specific to certain types of product.', 'woocommerce' )
'description' => __( 'Choose a tax class for this product. Tax classes are used to apply different tax rates specific to certain types of product.', 'woocommerce' ),
) );
do_action( 'woocommerce_product_options_tax' );
@ -305,16 +305,16 @@ class WC_Meta_Box_Product_Data {
'description' => __( 'Stock quantity. If this is a variable product this value will be used to control stock for all variations, unless you define stock at variation level.', 'woocommerce' ),
'type' => 'number',
'custom_attributes' => array(
'step' => 'any'
'step' => 'any',
),
'data_type' => 'stock'
'data_type' => 'stock',
) );
// Backorders?
woocommerce_wp_select( array( 'id' => '_backorders', 'label' => __( 'Allow backorders?', 'woocommerce' ), 'options' => array(
'no' => __( 'Do not allow', 'woocommerce' ),
'notify' => __( 'Allow, but notify customer', 'woocommerce' ),
'yes' => __( 'Allow', 'woocommerce' )
'yes' => __( 'Allow', 'woocommerce' ),
), 'desc_tip' => true, 'description' => __( 'If managing stock, this controls whether or not backorders are allowed. If enabled, stock quantity can go below 0.', 'woocommerce' ) ) );
do_action( 'woocommerce_product_options_stock_fields' );
@ -326,7 +326,7 @@ class WC_Meta_Box_Product_Data {
// Stock status
woocommerce_wp_select( array( 'id' => '_stock_status', 'wrapper_class' => 'hide_if_variable hide_if_external', 'label' => __( 'Stock status', 'woocommerce' ), 'options' => array(
'instock' => __( 'In stock', 'woocommerce' ),
'outofstock' => __( 'Out of stock', 'woocommerce' )
'outofstock' => __( 'Out of stock', 'woocommerce' ),
), 'desc_tip' => true, 'description' => __( 'Controls whether or not the product is listed as "in stock" or "out of stock" on the frontend.', 'woocommerce' ) ) );
do_action( 'woocommerce_product_options_stock_status' );
@ -392,7 +392,7 @@ class WC_Meta_Box_Product_Data {
'name' => 'product_shipping_class',
'id' => 'product_shipping_class',
'selected' => $current_shipping_class,
'class' => 'select short'
'class' => 'select short',
);
?><p class="form-field dimensions_field"><label for="product_shipping_class"><?php _e( 'Shipping class', 'woocommerce' ); ?></label> <?php wp_dropdown_categories( $args ); ?> <?php echo wc_help_tip( __( 'Shipping classes are used by certain shipping methods to group similar products.', 'woocommerce' ) ); ?></p><?php
@ -551,7 +551,7 @@ class WC_Meta_Box_Product_Data {
<?php
// menu_order
woocommerce_wp_text_input( array( 'id' => 'menu_order', 'label' => __( 'Menu order', 'woocommerce' ), 'desc_tip' => 'true', 'description' => __( 'Custom ordering position.', 'woocommerce' ), 'value' => intval( $post->menu_order ), 'type' => 'number', 'custom_attributes' => array(
'step' => '1'
'step' => '1',
) ) );
?>
</div>
@ -930,7 +930,7 @@ class WC_Meta_Box_Product_Data {
'position' => $attribute_position[ $i ],
'is_visible' => $is_visible,
'is_variation' => $is_variation,
'is_taxonomy' => $is_taxonomy
'is_taxonomy' => $is_taxonomy,
);
}
@ -947,7 +947,7 @@ class WC_Meta_Box_Product_Data {
'position' => $attribute_position[ $i ],
'is_visible' => $is_visible,
'is_variation' => $is_variation,
'is_taxonomy' => $is_taxonomy
'is_taxonomy' => $is_taxonomy,
);
}
}
@ -1044,7 +1044,7 @@ class WC_Meta_Box_Product_Data {
'meta_key' => '_price',
'posts_per_page' => 1,
'post_type' => 'product',
'fields' => 'ids'
'fields' => 'ids',
) );
if ( $children_by_price ) {
@ -1182,7 +1182,7 @@ class WC_Meta_Box_Product_Data {
$files[ $file_hash ] = array(
'name' => $file_name,
'file' => $file_url
'file' => $file_url,
);
}
}
@ -1298,7 +1298,7 @@ class WC_Meta_Box_Product_Data {
'post_author' => get_current_user_id(),
'post_parent' => $post_id,
'post_type' => 'product_variation',
'menu_order' => $variable_menu_order[ $i ]
'menu_order' => $variable_menu_order[ $i ],
);
$variation_id = wp_insert_post( $variation );
@ -1314,7 +1314,7 @@ class WC_Meta_Box_Product_Data {
'post_title' => $variation_post_title,
'menu_order' => $variable_menu_order[ $i ],
'post_modified' => $modified_date,
'post_modified_gmt' => get_gmt_from_date( $modified_date )
'post_modified_gmt' => get_gmt_from_date( $modified_date ),
), array( 'ID' => $variation_id ) );
clean_post_cache( $variation_id );
@ -1472,7 +1472,7 @@ class WC_Meta_Box_Product_Data {
$files[ $file_hash ] = array(
'name' => $file_name,
'file' => $file_url
'file' => $file_url,
);
}
}

View File

@ -33,7 +33,7 @@ class WC_Meta_Box_Product_Short_Description {
'theme_advanced_buttons1' => 'bold,italic,strikethrough,separator,bullist,numlist,separator,blockquote,separator,justifyleft,justifycenter,justifyright,separator,link,unlink,separator,undo,redo,separator',
'theme_advanced_buttons2' => '',
),
'editor_css' => '<style>#wp-excerpt-editor-container .wp-editor-area{height:175px; width:100%;}</style>'
'editor_css' => '<style>#wp-excerpt-editor-container .wp-editor-area{height:175px; width:100%;}</style>',
);
wp_editor( htmlspecialchars_decode( $post->post_excerpt ), 'excerpt', apply_filters( 'woocommerce_product_short_description_editor_settings', $settings ) );

View File

@ -33,7 +33,7 @@ if ( ! defined( 'ABSPATH' ) ) {
'download_file' => $download->product_id,
'order' => $download->order_key,
'email' => urlencode( $download->user_email ),
'key' => $download->download_id
'key' => $download->download_id,
), trailingslashit( home_url() ) );
echo '<a href="' . esc_url( $download_link ) . '">' . esc_html( $file_count ) . '</a>';

View File

@ -31,7 +31,7 @@
<?php
$args = array(
'orderby' => 'name',
'hide_empty' => 0
'hide_empty' => 0,
);
$all_terms = get_terms( $taxonomy, apply_filters( 'woocommerce_product_attribute_terms', $args ) );
if ( $all_terms ) {

View File

@ -212,7 +212,7 @@ extract( $variation_data );
'name' => 'variable_shipping_class[' . $loop . ']',
'id' => '',
'selected' => isset( $shipping_class ) ? esc_attr( $shipping_class ) : '',
'echo' => 0
'echo' => 0,
);
echo wp_dropdown_categories( $args );
@ -267,7 +267,7 @@ extract( $variation_data );
if ( ! is_array( $file ) ) {
$file = array(
'file' => $file,
'name' => ''
'name' => '',
);
}
include( 'html-product-variation-download.php' );
@ -281,7 +281,7 @@ extract( $variation_data );
<a href="#" class="button insert" data-row="<?php
$file = array(
'file' => '',
'name' => ''
'name' => '',
);
ob_start();
include( 'html-product-variation-download.php' );

View File

@ -417,35 +417,35 @@ class WC_Admin_Report {
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => '',
'name' => 'product_id'
'name' => 'product_id',
),
$meta_key => array(
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => 'SUM',
'name' => 'sparkline_value'
'name' => 'sparkline_value',
),
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
'name' => 'post_date',
),
),
'where' => array(
array(
'key' => 'post_date',
'value' => date( 'Y-m-d', strtotime( 'midnight -' . ( $days - 1 ) . ' days', current_time( 'timestamp' ) ) ),
'operator' => '>'
'operator' => '>',
),
array(
'key' => 'order_item_meta__product_id.meta_value',
'value' => $id,
'operator' => '='
'operator' => '=',
)
),
'group_by' => 'YEAR(posts.post_date), MONTH(posts.post_date), DAY(posts.post_date)',
'query_type' => 'get_results',
'filter_range' => false
'filter_range' => false,
) );
} else {
@ -454,24 +454,24 @@ class WC_Admin_Report {
'_order_total' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'sparkline_value'
'name' => 'sparkline_value',
),
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
'name' => 'post_date',
),
),
'where' => array(
array(
'key' => 'post_date',
'value' => date( 'Y-m-d', strtotime( 'midnight -' . ( $days - 1 ) . ' days', current_time( 'timestamp' ) ) ),
'operator' => '>'
'operator' => '>',
)
),
'group_by' => 'YEAR(posts.post_date), MONTH(posts.post_date), DAY(posts.post_date)',
'query_type' => 'get_results',
'filter_range' => false
'filter_range' => false,
) );
}

View File

@ -53,14 +53,14 @@ class WC_Report_Coupon_Usage extends WC_Admin_Report {
'type' => 'order_item_meta',
'order_item_type' => 'coupon',
'function' => 'SUM',
'name' => 'discount_amount'
)
'name' => 'discount_amount',
),
),
'where' => array(
array(
'key' => 'order_item_type',
'value' => 'coupon',
'operator' => '='
'operator' => '=',
)
),
'query_type' => 'get_var',
@ -74,14 +74,14 @@ class WC_Report_Coupon_Usage extends WC_Admin_Report {
'type' => 'order_item',
'order_item_type' => 'coupon',
'function' => 'COUNT',
'name' => 'order_coupon_count'
)
'name' => 'order_coupon_count',
),
),
'where' => array(
array(
'key' => 'order_item_type',
'value' => 'coupon',
'operator' => '='
'operator' => '=',
)
),
'query_type' => 'get_var',
@ -94,7 +94,7 @@ class WC_Report_Coupon_Usage extends WC_Admin_Report {
'type' => 'order_item',
'key' => 'order_item_name',
'value' => $this->coupon_codes,
'operator' => 'IN'
'operator' => 'IN',
);
$total_discount_query['where'][] = $coupon_code_query;
@ -107,13 +107,13 @@ class WC_Report_Coupon_Usage extends WC_Admin_Report {
$legend[] = array(
'title' => sprintf( __( '%s discounts in total', 'woocommerce' ), '<strong>' . wc_price( $total_discount ) . '</strong>' ),
'color' => $this->chart_colours['discount_amount'],
'highlight_series' => 1
'highlight_series' => 1,
);
$legend[] = array(
'title' => sprintf( __( '%s coupons used in total', 'woocommerce' ), '<strong>' . $total_coupons . '</strong>' ),
'color' => $this->chart_colours['coupon_count' ],
'highlight_series' => 0
'highlight_series' => 0,
);
return $legend;
@ -128,7 +128,7 @@ class WC_Report_Coupon_Usage extends WC_Admin_Report {
'year' => __( 'Year', 'woocommerce' ),
'last_month' => __( 'Last Month', 'woocommerce' ),
'month' => __( 'This Month', 'woocommerce' ),
'7day' => __( 'Last 7 Days', 'woocommerce' )
'7day' => __( 'Last 7 Days', 'woocommerce' ),
);
$this->chart_colours = array(
@ -157,7 +157,7 @@ class WC_Report_Coupon_Usage extends WC_Admin_Report {
$widgets[] = array(
'title' => '',
'callback' => array( $this, 'coupons_widget' )
'callback' => array( $this, 'coupons_widget' ),
);
return $widgets;
@ -180,18 +180,18 @@ class WC_Report_Coupon_Usage extends WC_Admin_Report {
'order_item_type' => 'coupon',
'function' => '',
'distinct' => true,
'name' => 'order_item_name'
)
'name' => 'order_item_name',
),
),
'where' => array(
array(
'key' => 'order_item_type',
'value' => 'coupon',
'operator' => '='
'operator' => '=',
)
),
'query_type' => 'get_col',
'filter_range' => false
'filter_range' => false,
) );
if ( ! empty( $used_coupons ) && is_array( $used_coupons ) ) :
@ -227,13 +227,13 @@ class WC_Report_Coupon_Usage extends WC_Admin_Report {
'type' => 'order_item',
'order_item_type' => 'coupon',
'function' => '',
'name' => 'coupon_code'
'name' => 'coupon_code',
),
'order_item_id' => array(
'type' => 'order_item',
'order_item_type' => 'coupon',
'function' => 'COUNT',
'name' => 'coupon_count'
'name' => 'coupon_count',
),
),
'where' => array(
@ -241,14 +241,14 @@ class WC_Report_Coupon_Usage extends WC_Admin_Report {
'type' => 'order_item',
'key' => 'order_item_type',
'value' => 'coupon',
'operator' => '='
'operator' => '=',
)
),
'order_by' => 'coupon_count DESC',
'group_by' => 'order_item_name',
'limit' => 12,
'query_type' => 'get_results',
'filter_range' => true
'filter_range' => true,
) );
if ( ! empty( $most_popular ) && is_array( $most_popular ) ) {
@ -274,28 +274,28 @@ class WC_Report_Coupon_Usage extends WC_Admin_Report {
'type' => 'order_item',
'order_item_type' => 'coupon',
'function' => '',
'name' => 'coupon_code'
'name' => 'coupon_code',
),
'discount_amount' => array(
'type' => 'order_item_meta',
'order_item_type' => 'coupon',
'function' => 'SUM',
'name' => 'discount_amount'
)
'name' => 'discount_amount',
),
),
'where' => array(
array(
'type' => 'order_item',
'key' => 'order_item_type',
'value' => 'coupon',
'operator' => '='
'operator' => '=',
)
),
'order_by' => 'discount_amount DESC',
'group_by' => 'order_item_name',
'limit' => 12,
'query_type' => 'get_results',
'filter_range' => true
'filter_range' => true,
) );
if ( ! empty( $most_discount ) && is_array( $most_discount ) ) {
@ -369,26 +369,26 @@ class WC_Report_Coupon_Usage extends WC_Admin_Report {
'type' => 'order_item',
'order_item_type' => 'coupon',
'function' => 'COUNT',
'name' => 'order_coupon_count'
'name' => 'order_coupon_count',
),
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
'name' => 'post_date',
),
),
'where' => array(
array(
'key' => 'order_item_type',
'value' => 'coupon',
'operator' => '='
'operator' => '=',
)
),
'group_by' => $this->group_by_query,
'order_by' => 'post_date ASC',
'query_type' => 'get_results',
'filter_range' => true,
'order_types' => wc_get_order_types( 'order-count' )
'order_types' => wc_get_order_types( 'order-count' ),
);
$order_discount_amounts_query = array(
@ -397,26 +397,26 @@ class WC_Report_Coupon_Usage extends WC_Admin_Report {
'type' => 'order_item_meta',
'order_item_type' => 'coupon',
'function' => 'SUM',
'name' => 'discount_amount'
'name' => 'discount_amount',
),
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
'name' => 'post_date',
),
),
'where' => array(
array(
'key' => 'order_item_type',
'value' => 'coupon',
'operator' => '='
'operator' => '=',
)
),
'group_by' => $this->group_by_query . ', order_item_name',
'order_by' => 'post_date ASC',
'query_type' => 'get_results',
'filter_range' => true,
'order_types' => wc_get_order_types( 'order-count' )
'order_types' => wc_get_order_types( 'order-count' ),
);
if ( ! empty( $this->coupon_codes ) ) {
@ -424,7 +424,7 @@ class WC_Report_Coupon_Usage extends WC_Admin_Report {
'type' => 'order_item',
'key' => 'order_item_name',
'value' => $this->coupon_codes,
'operator' => 'IN'
'operator' => 'IN',
);
$order_coupon_counts_query['where'][] = $coupon_code_query;
@ -441,7 +441,7 @@ class WC_Report_Coupon_Usage extends WC_Admin_Report {
// Encode in json format
$chart_data = json_encode( array(
'order_coupon_counts' => array_values( $order_coupon_counts ),
'order_discount_amounts' => array_values( $order_discount_amounts )
'order_discount_amounts' => array_values( $order_discount_amounts ),
) );
?>
<div class="chart-container">

View File

@ -26,7 +26,7 @@ class WC_Report_Customer_List extends WP_List_Table {
parent::__construct( array(
'singular' => __( 'Customer', 'woocommerce' ),
'plural' => __( 'Customers', 'woocommerce' ),
'ajax' => false
'ajax' => false,
) );
}
@ -128,7 +128,7 @@ class WC_Report_Customer_List extends WP_List_Table {
$orders = wc_get_orders( array(
'limit' => 1,
'status' => array( 'wc-completed', 'wc-processing' ),
'customer' => $user->ID
'customer' => $user->ID,
) );
if ( ! empty( $orders ) ) {
@ -151,19 +151,19 @@ class WC_Report_Customer_List extends WP_List_Table {
$actions['refresh'] = array(
'url' => wp_nonce_url( add_query_arg( 'refresh', $user->ID ), 'refresh' ),
'name' => __( 'Refresh stats', 'woocommerce' ),
'action' => "refresh"
'action' => "refresh",
);
$actions['edit'] = array(
'url' => admin_url( 'user-edit.php?user_id=' . $user->ID ),
'name' => __( 'Edit', 'woocommerce' ),
'action' => "edit"
'action' => "edit",
);
$actions['view'] = array(
'url' => admin_url( 'edit.php?post_type=shop_order&_customer_user=' . $user->ID ),
'name' => __( 'View orders', 'woocommerce' ),
'action' => "view"
'action' => "view",
);
$orders = wc_get_orders( array(
@ -176,7 +176,7 @@ class WC_Report_Customer_List extends WP_List_Table {
$actions['link'] = array(
'url' => wp_nonce_url( add_query_arg( 'link_orders', $user->ID ), 'link_orders' ),
'name' => __( 'Link previous orders', 'woocommerce' ),
'action' => "link"
'action' => "link",
);
}
@ -212,7 +212,7 @@ class WC_Report_Customer_List extends WP_List_Table {
'orders' => __( 'Orders', 'woocommerce' ),
'spent' => __( 'Money Spent', 'woocommerce' ),
'last_order' => __( 'Last order', 'woocommerce' ),
'user_actions' => __( 'Actions', 'woocommerce' )
'user_actions' => __( 'Actions', 'woocommerce' ),
);
return $columns;
@ -263,21 +263,21 @@ class WC_Report_Customer_List extends WP_List_Table {
$admin_users = new WP_User_Query(
array(
'role' => 'administrator1',
'fields' => 'ID'
'fields' => 'ID',
)
);
$manager_users = new WP_User_Query(
array(
'role' => 'shop_manager',
'fields' => 'ID'
'fields' => 'ID',
)
);
$query = new WP_User_Query( array(
'exclude' => array_merge( $admin_users->get_results(), $manager_users->get_results() ),
'number' => $per_page,
'offset' => ( $current_page - 1 ) * $per_page
'offset' => ( $current_page - 1 ) * $per_page,
) );
$this->items = $query->get_results();
@ -290,7 +290,7 @@ class WC_Report_Customer_List extends WP_List_Table {
$this->set_pagination_args( array(
'total_items' => $query->total_users,
'per_page' => $per_page,
'total_pages' => ceil( $query->total_users / $per_page )
'total_pages' => ceil( $query->total_users / $per_page ),
) );
}
}

View File

@ -39,7 +39,7 @@ class WC_Report_Customers extends WC_Admin_Report {
$legend[] = array(
'title' => sprintf( __( '%s signups in this period', 'woocommerce' ), '<strong>' . sizeof( $this->customers ) . '</strong>' ),
'color' => $this->chart_colours['signups'],
'highlight_series' => 2
'highlight_series' => 2,
);
return $legend;
@ -55,7 +55,7 @@ class WC_Report_Customers extends WC_Admin_Report {
$widgets[] = array(
'title' => '',
'callback' => array( $this, 'customers_vs_guests' )
'callback' => array( $this, 'customers_vs_guests' ),
);
return $widgets;
@ -71,17 +71,17 @@ class WC_Report_Customers extends WC_Admin_Report {
'ID' => array(
'type' => 'post_data',
'function' => 'COUNT',
'name' => 'total_orders'
)
'name' => 'total_orders',
),
),
'where_meta' => array(
array(
'meta_key' => '_customer_user',
'meta_value' => '0',
'operator' => '>'
'operator' => '>',
)
),
'filter_range' => true
'filter_range' => true,
) );
$guest_order_totals = $this->get_order_report_data( array(
@ -89,17 +89,17 @@ class WC_Report_Customers extends WC_Admin_Report {
'ID' => array(
'type' => 'post_data',
'function' => 'COUNT',
'name' => 'total_orders'
)
'name' => 'total_orders',
),
),
'where_meta' => array(
array(
'meta_key' => '_customer_user',
'meta_value' => '0',
'operator' => '='
'operator' => '=',
)
),
'filter_range' => true
'filter_range' => true,
) );
?>
<div class="chart-container">
@ -162,13 +162,13 @@ class WC_Report_Customers extends WC_Admin_Report {
'year' => __( 'Year', 'woocommerce' ),
'last_month' => __( 'Last Month', 'woocommerce' ),
'month' => __( 'This Month', 'woocommerce' ),
'7day' => __( 'Last 7 Days', 'woocommerce' )
'7day' => __( 'Last 7 Days', 'woocommerce' ),
);
$this->chart_colours = array(
'signups' => '#3498db',
'customers' => '#1abc9c',
'guests' => '#8fdece'
'guests' => '#8fdece',
);
$current_range = ! empty( $_GET['range'] ) ? sanitize_text_field( $_GET['range'] ) : '7day';
@ -182,21 +182,21 @@ class WC_Report_Customers extends WC_Admin_Report {
$admin_users = new WP_User_Query(
array(
'role' => 'administrator',
'fields' => 'ID'
'fields' => 'ID',
)
);
$manager_users = new WP_User_Query(
array(
'role' => 'shop_manager',
'fields' => 'ID'
'fields' => 'ID',
)
);
$users_query = new WP_User_Query(
array(
'fields' => array( 'user_registered' ),
'exclude' => array_merge( $admin_users->get_results(), $manager_users->get_results() )
'exclude' => array_merge( $admin_users->get_results(), $manager_users->get_results() ),
)
);
@ -242,25 +242,25 @@ class WC_Report_Customers extends WC_Admin_Report {
'ID' => array(
'type' => 'post_data',
'function' => 'COUNT',
'name' => 'total_orders'
'name' => 'total_orders',
),
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
'name' => 'post_date',
),
),
'where_meta' => array(
array(
'meta_key' => '_customer_user',
'meta_value' => '0',
'operator' => '>'
'operator' => '>',
)
),
'group_by' => $this->group_by_query,
'order_by' => 'post_date ASC',
'query_type' => 'get_results',
'filter_range' => true
'filter_range' => true,
) );
$guest_orders = $this->get_order_report_data( array(
@ -268,25 +268,25 @@ class WC_Report_Customers extends WC_Admin_Report {
'ID' => array(
'type' => 'post_data',
'function' => 'COUNT',
'name' => 'total_orders'
'name' => 'total_orders',
),
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
'name' => 'post_date',
),
),
'where_meta' => array(
array(
'meta_key' => '_customer_user',
'meta_value' => '0',
'operator' => '='
'operator' => '=',
)
),
'group_by' => $this->group_by_query,
'order_by' => 'post_date ASC',
'query_type' => 'get_results',
'filter_range' => true
'filter_range' => true,
) );
$signups = $this->prepare_chart_data( $this->customers, 'user_registered', '', $this->chart_interval, $this->start_date, $this->chart_groupby );
@ -297,7 +297,7 @@ class WC_Report_Customers extends WC_Admin_Report {
$chart_data = json_encode( array(
'signups' => array_values( $signups ),
'customer_orders' => array_values( $customer_orders ),
'guest_orders' => array_values( $guest_orders )
'guest_orders' => array_values( $guest_orders ),
) );
?>
<div class="chart-container">

View File

@ -95,7 +95,7 @@ class WC_Report_Sales_By_Category extends WC_Admin_Report {
$legend[] = array(
'title' => sprintf( __( '%s sales in %s', 'woocommerce' ), '<strong>' . wc_price( $total ) . '</strong>', $category->name ),
'color' => isset( $this->chart_colours[ $index ] ) ? $this->chart_colours[ $index ] : $this->chart_colours[ 0 ],
'highlight_series' => $index
'highlight_series' => $index,
);
$index++;
@ -113,7 +113,7 @@ class WC_Report_Sales_By_Category extends WC_Admin_Report {
'year' => __( 'Year', 'woocommerce' ),
'last_month' => __( 'Last Month', 'woocommerce' ),
'month' => __( 'This Month', 'woocommerce' ),
'7day' => __( 'Last 7 Days', 'woocommerce' )
'7day' => __( 'Last 7 Days', 'woocommerce' ),
);
$this->chart_colours = array( '#3498db', '#34495e', '#1abc9c', '#2ecc71', '#f1c40f', '#e67e22', '#e74c3c', '#2980b9', '#8e44ad', '#2c3e50', '#16a085', '#27ae60', '#f39c12', '#d35400', '#c0392b' );
@ -134,23 +134,23 @@ class WC_Report_Sales_By_Category extends WC_Admin_Report {
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => '',
'name' => 'product_id'
'name' => 'product_id',
),
'_line_total' => array(
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => 'SUM',
'name' => 'order_item_amount'
'name' => 'order_item_amount',
),
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
'name' => 'post_date',
),
),
'group_by' => 'ID, product_id, post_date',
'query_type' => 'get_results',
'filter_range' => true
'filter_range' => true,
) );
$this->item_sales = array();
@ -190,7 +190,7 @@ class WC_Report_Sales_By_Category extends WC_Admin_Report {
return array(
array(
'title' => __( 'Categories', 'woocommerce' ),
'callback' => array( $this, 'category_widget' )
'callback' => array( $this, 'category_widget' ),
)
);
}

View File

@ -56,15 +56,15 @@ class WC_Report_Sales_By_Date extends WC_Admin_Report {
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
)
'name' => 'post_date',
),
),
'group_by' => $this->group_by_query,
'order_by' => 'post_date ASC',
'query_type' => 'get_results',
'filter_range' => true,
'order_types' => wc_get_order_types( 'order-count' ),
'order_status' => array( 'completed', 'processing', 'on-hold', 'refunded' )
'order_status' => array( 'completed', 'processing', 'on-hold', 'refunded' ),
) );
$this->report_data->coupons = (array) $this->get_order_report_data( array(
@ -72,25 +72,25 @@ class WC_Report_Sales_By_Date extends WC_Admin_Report {
'order_item_name' => array(
'type' => 'order_item',
'function' => '',
'name' => 'order_item_name'
'name' => 'order_item_name',
),
'discount_amount' => array(
'type' => 'order_item_meta',
'order_item_type' => 'coupon',
'function' => 'SUM',
'name' => 'discount_amount'
'name' => 'discount_amount',
),
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
'name' => 'post_date',
),
),
'where' => array(
array(
'key' => 'order_items.order_item_type',
'value' => 'coupon',
'operator' => '='
'operator' => '=',
)
),
'group_by' => $this->group_by_query . ', order_item_name',
@ -98,7 +98,7 @@ class WC_Report_Sales_By_Date extends WC_Admin_Report {
'query_type' => 'get_results',
'filter_range' => true,
'order_types' => wc_get_order_types( 'order-count' ),
'order_status' => array( 'completed', 'processing', 'on-hold', 'refunded' )
'order_status' => array( 'completed', 'processing', 'on-hold', 'refunded' ),
) );
// All items from orders - even those refunded
@ -108,19 +108,19 @@ class WC_Report_Sales_By_Date extends WC_Admin_Report {
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => 'SUM',
'name' => 'order_item_count'
'name' => 'order_item_count',
),
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
'name' => 'post_date',
),
),
'where' => array(
array(
'key' => 'order_items.order_item_type',
'value' => 'line_item',
'operator' => '='
'operator' => '=',
)
),
'group_by' => $this->group_by_query,
@ -140,20 +140,20 @@ class WC_Report_Sales_By_Date extends WC_Admin_Report {
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => 'SUM',
'name' => 'order_item_count'
)
'name' => 'order_item_count',
),
),
'where' => array(
array(
'key' => 'order_items.order_item_type',
'value' => 'line_item',
'operator' => '='
'operator' => '=',
)
),
'query_type' => 'get_var',
'filter_range' => true,
'order_types' => wc_get_order_types( 'order-count' ),
'order_status' => array( 'refunded' )
'order_status' => array( 'refunded' ),
) ) );
/**
@ -164,27 +164,27 @@ class WC_Report_Sales_By_Date extends WC_Admin_Report {
'_order_total' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'total_sales'
'name' => 'total_sales',
),
'_order_shipping' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'total_shipping'
'name' => 'total_shipping',
),
'_order_tax' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'total_tax'
'name' => 'total_tax',
),
'_order_shipping_tax' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'total_shipping_tax'
'name' => 'total_shipping_tax',
),
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
'name' => 'post_date',
),
),
'group_by' => $this->group_by_query,
@ -192,7 +192,7 @@ class WC_Report_Sales_By_Date extends WC_Admin_Report {
'query_type' => 'get_results',
'filter_range' => true,
'order_types' => wc_get_order_types( 'sales-reports' ),
'order_status' => array( 'completed', 'processing', 'on-hold', 'refunded' )
'order_status' => array( 'completed', 'processing', 'on-hold', 'refunded' ),
) );
/**
@ -204,34 +204,34 @@ class WC_Report_Sales_By_Date extends WC_Admin_Report {
'_order_total' => array(
'type' => 'parent_meta',
'function' => '',
'name' => 'total_refund'
'name' => 'total_refund',
),
'_order_shipping' => array(
'type' => 'parent_meta',
'function' => '',
'name' => 'total_shipping'
'name' => 'total_shipping',
),
'_order_tax' => array(
'type' => 'parent_meta',
'function' => '',
'name' => 'total_tax'
'name' => 'total_tax',
),
'_order_shipping_tax' => array(
'type' => 'parent_meta',
'function' => '',
'name' => 'total_shipping_tax'
'name' => 'total_shipping_tax',
),
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
)
'name' => 'post_date',
),
),
'group_by' => 'posts.post_parent',
'query_type' => 'get_results',
'filter_range' => true,
'order_status' => false,
'parent_order_status' => array( 'refunded' )
'parent_order_status' => array( 'refunded' ),
) );
/**
@ -242,53 +242,53 @@ class WC_Report_Sales_By_Date extends WC_Admin_Report {
'ID' => array(
'type' => 'post_data',
'function' => '',
'name' => 'refund_id'
'name' => 'refund_id',
),
'_refund_amount' => array(
'type' => 'meta',
'function' => '',
'name' => 'total_refund'
'name' => 'total_refund',
),
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
'name' => 'post_date',
),
'order_item_type' => array(
'type' => 'order_item',
'function' => '',
'name' => 'item_type',
'join_type' => 'LEFT'
'join_type' => 'LEFT',
),
'_order_total' => array(
'type' => 'meta',
'function' => '',
'name' => 'total_sales'
'name' => 'total_sales',
),
'_order_shipping' => array(
'type' => 'meta',
'function' => '',
'name' => 'total_shipping',
'join_type' => 'LEFT'
'join_type' => 'LEFT',
),
'_order_tax' => array(
'type' => 'meta',
'function' => '',
'name' => 'total_tax',
'join_type' => 'LEFT'
'join_type' => 'LEFT',
),
'_order_shipping_tax' => array(
'type' => 'meta',
'function' => '',
'name' => 'total_shipping_tax',
'join_type' => 'LEFT'
'join_type' => 'LEFT',
),
'_qty' => array(
'type' => 'order_item_meta',
'function' => 'SUM',
'name' => 'order_item_count',
'join_type' => 'LEFT'
)
'join_type' => 'LEFT',
),
),
'group_by' => 'refund_id',
'order_by' => 'post_date ASC',
@ -373,13 +373,13 @@ class WC_Report_Sales_By_Date extends WC_Admin_Report {
'title' => sprintf( __( '%s gross sales in this period', 'woocommerce' ), '<strong>' . wc_price( $data->total_sales ) . '</strong>' ),
'placeholder' => __( 'This is the sum of the order totals after any refunds and including shipping and taxes.', 'woocommerce' ),
'color' => $this->chart_colours['sales_amount'],
'highlight_series' => 6
'highlight_series' => 6,
);
if ( $data->average_total_sales > 0 ) {
$legend[] = array(
'title' => $average_total_sales_title,
'color' => $this->chart_colours['average'],
'highlight_series' => 2
'highlight_series' => 2,
);
}
@ -387,41 +387,41 @@ class WC_Report_Sales_By_Date extends WC_Admin_Report {
'title' => sprintf( __( '%s net sales in this period', 'woocommerce' ), '<strong>' . wc_price( $data->net_sales ) . '</strong>' ),
'placeholder' => __( 'This is the sum of the order totals after any refunds and excluding shipping and taxes.', 'woocommerce' ),
'color' => $this->chart_colours['net_sales_amount'],
'highlight_series' => 7
'highlight_series' => 7,
);
if ( $data->average_sales > 0 ) {
$legend[] = array(
'title' => $average_sales_title,
'color' => $this->chart_colours['net_average'],
'highlight_series' => 3
'highlight_series' => 3,
);
}
$legend[] = array(
'title' => sprintf( __( '%s orders placed', 'woocommerce' ), '<strong>' . $data->total_orders . '</strong>' ),
'color' => $this->chart_colours['order_count'],
'highlight_series' => 1
'highlight_series' => 1,
);
$legend[] = array(
'title' => sprintf( __( '%s items purchased', 'woocommerce' ), '<strong>' . $data->total_items . '</strong>' ),
'color' => $this->chart_colours['item_count'],
'highlight_series' => 0
'highlight_series' => 0,
);
$legend[] = array(
'title' => sprintf( _nx( '%s refunded %d order', '%s refunded %d orders', $this->report_data->total_refunded_orders, '%s = amount of the refunds, %d = number of refunded orders.', 'woocommerce' ), '<strong>' . wc_price( $data->total_refunds ) . '</strong>', $this->report_data->total_refunded_orders ) . ' (' . sprintf( _n( '%d item', '%d items', $this->report_data->refunded_order_items, 'woocommerce' ), $this->report_data->refunded_order_items ) . ')',
'color' => $this->chart_colours['refund_amount'],
'highlight_series' => 8
'highlight_series' => 8,
);
$legend[] = array(
'title' => sprintf( __( '%s charged for shipping', 'woocommerce' ), '<strong>' . wc_price( $data->total_shipping ) . '</strong>' ),
'color' => $this->chart_colours['shipping_amount'],
'highlight_series' => 5
'highlight_series' => 5,
);
$legend[] = array(
'title' => sprintf( __( '%s worth of coupons used', 'woocommerce' ), '<strong>' . wc_price( $data->total_coupons ) . '</strong>' ),
'color' => $this->chart_colours['coupon_amount'],
'highlight_series' => 4
'highlight_series' => 4,
);
return $legend;
@ -435,7 +435,7 @@ class WC_Report_Sales_By_Date extends WC_Admin_Report {
'year' => __( 'Year', 'woocommerce' ),
'last_month' => __( 'Last Month', 'woocommerce' ),
'month' => __( 'This Month', 'woocommerce' ),
'7day' => __( 'Last 7 Days', 'woocommerce' )
'7day' => __( 'Last 7 Days', 'woocommerce' ),
);
$this->chart_colours = array(
@ -447,7 +447,7 @@ class WC_Report_Sales_By_Date extends WC_Admin_Report {
'item_count' => '#ecf0f1',
'shipping_amount' => '#5cc488',
'coupon_amount' => '#f1c40f',
'refund_amount' => '#e74c3c'
'refund_amount' => '#e74c3c',
);
$current_range = ! empty( $_GET['range'] ) ? sanitize_text_field( $_GET['range'] ) : '7day';
@ -513,7 +513,7 @@ class WC_Report_Sales_By_Date extends WC_Admin_Report {
'shipping_tax_amounts' => $this->prepare_chart_data( $this->report_data->orders, 'post_date', 'total_shipping_tax', $this->chart_interval, $this->start_date, $this->chart_groupby ),
'tax_amounts' => $this->prepare_chart_data( $this->report_data->orders, 'post_date', 'total_tax', $this->chart_interval, $this->start_date, $this->chart_groupby ),
'net_order_amounts' => array(),
'gross_order_amounts' => array()
'gross_order_amounts' => array(),
);
foreach ( $data['order_amounts'] as $order_amount_key => $order_amount_value ) {
@ -541,7 +541,7 @@ class WC_Report_Sales_By_Date extends WC_Admin_Report {
'net_order_amounts' => array_map( array( $this, 'round_chart_totals' ), array_values( $data['net_order_amounts'] ) ),
'shipping_amounts' => array_map( array( $this, 'round_chart_totals' ), array_values( $data['shipping_amounts'] ) ),
'coupon_amounts' => array_map( array( $this, 'round_chart_totals' ), array_values( $data['coupon_amounts'] ) ),
'refund_amounts' => array_map( array( $this, 'round_chart_totals' ), array_values( $data['refund_amounts'] ) )
'refund_amounts' => array_map( array( $this, 'round_chart_totals' ), array_values( $data['refund_amounts'] ) ),
) );
?>
<div class="chart-container">

View File

@ -64,8 +64,8 @@ class WC_Report_Sales_By_Product extends WC_Admin_Report {
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => 'SUM',
'name' => 'order_item_amount'
)
'name' => 'order_item_amount',
),
),
'where_meta' => array(
'relation' => 'OR',
@ -73,11 +73,11 @@ class WC_Report_Sales_By_Product extends WC_Admin_Report {
'type' => 'order_item_meta',
'meta_key' => array( '_product_id', '_variation_id' ),
'meta_value' => $this->product_ids,
'operator' => 'IN'
'operator' => 'IN',
)
),
'query_type' => 'get_var',
'filter_range' => true
'filter_range' => true,
) );
$total_items = absint( $this->get_order_report_data( array(
@ -86,8 +86,8 @@ class WC_Report_Sales_By_Product extends WC_Admin_Report {
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => 'SUM',
'name' => 'order_item_count'
)
'name' => 'order_item_count',
),
),
'where_meta' => array(
'relation' => 'OR',
@ -95,23 +95,23 @@ class WC_Report_Sales_By_Product extends WC_Admin_Report {
'type' => 'order_item_meta',
'meta_key' => array( '_product_id', '_variation_id' ),
'meta_value' => $this->product_ids,
'operator' => 'IN'
'operator' => 'IN',
)
),
'query_type' => 'get_var',
'filter_range' => true
'filter_range' => true,
) ) );
$legend[] = array(
'title' => sprintf( __( '%s sales for the selected items', 'woocommerce' ), '<strong>' . wc_price( $total_sales ) . '</strong>' ),
'color' => $this->chart_colours['sales_amount'],
'highlight_series' => 1
'highlight_series' => 1,
);
$legend[] = array(
'title' => sprintf( __( '%s purchases for the selected items', 'woocommerce' ), '<strong>' . ( $total_items ) . '</strong>' ),
'color' => $this->chart_colours['item_count'],
'highlight_series' => 0
'highlight_series' => 0,
);
return $legend;
@ -126,7 +126,7 @@ class WC_Report_Sales_By_Product extends WC_Admin_Report {
'year' => __( 'Year', 'woocommerce' ),
'last_month' => __( 'Last Month', 'woocommerce' ),
'month' => __( 'This Month', 'woocommerce' ),
'7day' => __( 'Last 7 Days', 'woocommerce' )
'7day' => __( 'Last 7 Days', 'woocommerce' ),
);
$this->chart_colours = array(
@ -156,13 +156,13 @@ class WC_Report_Sales_By_Product extends WC_Admin_Report {
if ( ! empty( $this->product_ids ) ) {
$widgets[] = array(
'title' => __( 'Showing reports for:', 'woocommerce' ),
'callback' => array( $this, 'current_filters' )
'callback' => array( $this, 'current_filters' ),
);
}
$widgets[] = array(
'title' => '',
'callback' => array( $this, 'products_widget' )
'callback' => array( $this, 'products_widget' ),
);
return $widgets;
@ -220,20 +220,20 @@ class WC_Report_Sales_By_Product extends WC_Admin_Report {
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => '',
'name' => 'product_id'
'name' => 'product_id',
),
'_qty' => array(
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => 'SUM',
'name' => 'order_item_qty'
)
'name' => 'order_item_qty',
),
),
'order_by' => 'order_item_qty DESC',
'group_by' => 'product_id',
'limit' => 12,
'query_type' => 'get_results',
'filter_range' => true
'filter_range' => true,
) );
if ( $top_sellers ) {
@ -260,28 +260,28 @@ class WC_Report_Sales_By_Product extends WC_Admin_Report {
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => '',
'name' => 'product_id'
'name' => 'product_id',
),
'_qty' => array(
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => 'SUM',
'name' => 'order_item_qty'
)
'name' => 'order_item_qty',
),
),
'where_meta' => array(
array(
'type' => 'order_item_meta',
'meta_key' => '_line_subtotal',
'meta_value' => '0',
'operator' => '='
'operator' => '=',
)
),
'order_by' => 'order_item_qty DESC',
'group_by' => 'product_id',
'limit' => 12,
'query_type' => 'get_results',
'filter_range' => true
'filter_range' => true,
) );
if ( $top_freebies ) {
@ -308,20 +308,20 @@ class WC_Report_Sales_By_Product extends WC_Admin_Report {
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => '',
'name' => 'product_id'
'name' => 'product_id',
),
'_line_total' => array(
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => 'SUM',
'name' => 'order_item_total'
)
'name' => 'order_item_total',
),
),
'order_by' => 'order_item_total DESC',
'group_by' => 'product_id',
'limit' => 12,
'query_type' => 'get_results',
'filter_range' => true
'filter_range' => true,
) );
if ( $top_earners ) {
@ -402,19 +402,19 @@ class WC_Report_Sales_By_Product extends WC_Admin_Report {
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => 'SUM',
'name' => 'order_item_count'
'name' => 'order_item_count',
),
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
'name' => 'post_date',
),
'_product_id' => array(
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => '',
'name' => 'product_id'
)
'name' => 'product_id',
),
),
'where_meta' => array(
'relation' => 'OR',
@ -422,13 +422,13 @@ class WC_Report_Sales_By_Product extends WC_Admin_Report {
'type' => 'order_item_meta',
'meta_key' => array( '_product_id', '_variation_id' ),
'meta_value' => $this->product_ids,
'operator' => 'IN'
'operator' => 'IN',
),
),
'group_by' => 'product_id,' . $this->group_by_query,
'order_by' => 'post_date ASC',
'query_type' => 'get_results',
'filter_range' => true
'filter_range' => true,
) );
$order_item_amounts = $this->get_order_report_data( array(
@ -437,18 +437,18 @@ class WC_Report_Sales_By_Product extends WC_Admin_Report {
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => 'SUM',
'name' => 'order_item_amount'
'name' => 'order_item_amount',
),
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
'name' => 'post_date',
),
'_product_id' => array(
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => '',
'name' => 'product_id'
'name' => 'product_id',
),
),
'where_meta' => array(
@ -457,13 +457,13 @@ class WC_Report_Sales_By_Product extends WC_Admin_Report {
'type' => 'order_item_meta',
'meta_key' => array( '_product_id', '_variation_id' ),
'meta_value' => $this->product_ids,
'operator' => 'IN'
'operator' => 'IN',
),
),
'group_by' => 'product_id, ' . $this->group_by_query,
'order_by' => 'post_date ASC',
'query_type' => 'get_results',
'filter_range' => true
'filter_range' => true,
) );
// Prepare data for report
@ -473,7 +473,7 @@ class WC_Report_Sales_By_Product extends WC_Admin_Report {
// Encode in json format
$chart_data = json_encode( array(
'order_item_counts' => array_values( $order_item_counts ),
'order_item_amounts' => array_values( $order_item_amounts )
'order_item_amounts' => array_values( $order_item_amounts ),
) );
?>
<div class="chart-container">

View File

@ -33,7 +33,7 @@ class WC_Report_Stock extends WP_List_Table {
parent::__construct( array(
'singular' => __( 'Stock', 'woocommerce' ),
'plural' => __( 'Stock', 'woocommerce' ),
'ajax' => false
'ajax' => false,
) );
}
@ -132,14 +132,14 @@ class WC_Report_Stock extends WP_List_Table {
$actions['edit'] = array(
'url' => admin_url( 'post.php?post=' . $action_id . '&action=edit' ),
'name' => __( 'Edit', 'woocommerce' ),
'action' => "edit"
'action' => "edit",
);
if ( $product->is_visible() ) {
$actions['view'] = array(
'url' => get_permalink( $action_id ),
'name' => __( 'View', 'woocommerce' ),
'action' => "view"
'action' => "view",
);
}
@ -189,7 +189,7 @@ class WC_Report_Stock extends WP_List_Table {
$this->set_pagination_args( array(
'total_items' => $this->max_items,
'per_page' => $per_page,
'total_pages' => ceil( $this->max_items / $per_page )
'total_pages' => ceil( $this->max_items / $per_page ),
) );
}
}

View File

@ -76,30 +76,30 @@ class WC_Report_Taxes_By_Code extends WC_Admin_Report {
'order_item_name' => array(
'type' => 'order_item',
'function' => '',
'name' => 'tax_rate'
'name' => 'tax_rate',
),
'tax_amount' => array(
'type' => 'order_item_meta',
'order_item_type' => 'tax',
'function' => '',
'name' => 'tax_amount'
'name' => 'tax_amount',
),
'shipping_tax_amount' => array(
'type' => 'order_item_meta',
'order_item_type' => 'tax',
'function' => '',
'name' => 'shipping_tax_amount'
'name' => 'shipping_tax_amount',
),
'rate_id' => array(
'type' => 'order_item_meta',
'order_item_type' => 'tax',
'function' => '',
'name' => 'rate_id'
'name' => 'rate_id',
),
'ID' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_id'
'name' => 'post_id',
),
);
@ -107,12 +107,12 @@ class WC_Report_Taxes_By_Code extends WC_Admin_Report {
array(
'key' => 'order_item_type',
'value' => 'tax',
'operator' => '='
'operator' => '=',
),
array(
'key' => 'order_item_name',
'value' => '',
'operator' => '!='
'operator' => '!=',
)
);
@ -124,7 +124,7 @@ class WC_Report_Taxes_By_Code extends WC_Admin_Report {
'filter_range' => true,
'order_types' => array_merge( wc_get_order_types( 'sales-reports' ), array( 'shop_order_refund' ) ),
'order_status' => array( 'completed', 'processing', 'on-hold' ),
'parent_order_status' => array( 'completed', 'processing', 'on-hold' ) // Partial refunds inside refunded orders should be ignored
'parent_order_status' => array( 'completed', 'processing', 'on-hold' ), // Partial refunds inside refunded orders should be ignored
) );
// Merge

View File

@ -74,22 +74,22 @@ class WC_Report_Taxes_By_Date extends WC_Admin_Report {
'_order_tax' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'tax_amount'
'name' => 'tax_amount',
),
'_order_shipping_tax' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'shipping_tax_amount'
'name' => 'shipping_tax_amount',
),
'_order_total' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'total_sales'
'name' => 'total_sales',
),
'_order_shipping' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'total_shipping'
'name' => 'total_shipping',
),
'ID' => array(
'type' => 'post_data',
@ -100,7 +100,7 @@ class WC_Report_Taxes_By_Date extends WC_Admin_Report {
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
'name' => 'post_date',
),
);
@ -111,7 +111,7 @@ class WC_Report_Taxes_By_Date extends WC_Admin_Report {
'query_type' => 'get_results',
'filter_range' => true,
'order_types' => wc_get_order_types( 'sales-reports' ),
'order_status' => array( 'completed', 'processing', 'on-hold' )
'order_status' => array( 'completed', 'processing', 'on-hold' ),
) );
$tax_rows_partial_refunds = $this->get_order_report_data( array(
@ -121,7 +121,7 @@ class WC_Report_Taxes_By_Date extends WC_Admin_Report {
'query_type' => 'get_results',
'filter_range' => true,
'order_types' => array( 'shop_order_refund' ),
'parent_order_status' => array( 'completed', 'processing', 'on-hold' ) // Partial refunds inside refunded orders should be ignored
'parent_order_status' => array( 'completed', 'processing', 'on-hold' ) ,// Partial refunds inside refunded orders should be ignored
) );
// Merge

View File

@ -64,7 +64,7 @@ class WC_Settings_Accounts extends WC_Settings_Page {
'default' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => 'start',
'autoload' => false
'autoload' => false,
),
array(
@ -73,7 +73,7 @@ class WC_Settings_Accounts extends WC_Settings_Page {
'default' => 'no',
'type' => 'checkbox',
'checkboxgroup' => 'end',
'autoload' => false
'autoload' => false,
),
array(
@ -83,7 +83,7 @@ class WC_Settings_Accounts extends WC_Settings_Page {
'default' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => 'start',
'autoload' => false
'autoload' => false,
),
array(
@ -93,7 +93,7 @@ class WC_Settings_Accounts extends WC_Settings_Page {
'default' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => 'start',
'autoload' => false
'autoload' => false,
),
array(
@ -102,7 +102,7 @@ class WC_Settings_Accounts extends WC_Settings_Page {
'default' => 'no',
'type' => 'checkbox',
'checkboxgroup' => 'end',
'autoload' => false
'autoload' => false,
),
array( 'type' => 'sectionend', 'id' => 'account_registration_options' ),

View File

@ -44,7 +44,7 @@ class WC_Settings_Rest_API extends WC_Settings_Page {
$sections = array(
'' => __( 'Settings', 'woocommerce' ),
'keys' => __( 'Keys/Apps', 'woocommerce' ),
'webhooks' => __( 'Webhooks', 'woocommerce' )
'webhooks' => __( 'Webhooks', 'woocommerce' ),
);
return apply_filters( 'woocommerce_get_sections_' . $this->id, $sections );
@ -61,7 +61,7 @@ class WC_Settings_Rest_API extends WC_Settings_Page {
'title' => __( 'General Options', 'woocommerce' ),
'type' => 'title',
'desc' => '',
'id' => 'general_options'
'id' => 'general_options',
),
array(
@ -74,7 +74,7 @@ class WC_Settings_Rest_API extends WC_Settings_Page {
array(
'type' => 'sectionend',
'id' => 'general_options'
'id' => 'general_options',
),
) );

View File

@ -41,7 +41,7 @@ class WC_Settings_Payment_Gateways extends WC_Settings_Page {
*/
public function get_sections() {
$sections = array(
'' => __( 'Checkout Options', 'woocommerce' )
'' => __( 'Checkout Options', 'woocommerce' ),
);
if ( ! defined( 'WC_INSTALLING' ) ) {
@ -289,7 +289,7 @@ class WC_Settings_Payment_Gateways extends WC_Settings_Page {
'sort' => '',
'name' => __( 'Gateway', 'woocommerce' ),
'id' => __( 'Gateway ID', 'woocommerce' ),
'status' => __( 'Enabled', 'woocommerce' )
'status' => __( 'Enabled', 'woocommerce' ),
) );
foreach ( $columns as $key => $column ) {

View File

@ -40,7 +40,7 @@ class WC_Settings_Emails extends WC_Settings_Page {
*/
public function get_sections() {
$sections = array(
'' => __( 'Email Options', 'woocommerce' )
'' => __( 'Email Options', 'woocommerce' ),
);
return apply_filters( 'woocommerce_get_sections_' . $this->id, $sections );
}
@ -71,7 +71,7 @@ class WC_Settings_Emails extends WC_Settings_Page {
'css' => 'min-width:300px;',
'default' => esc_attr( get_bloginfo( 'name', 'display' ) ),
'autoload' => false,
'desc_tip' => true
'desc_tip' => true,
),
array(
@ -80,12 +80,12 @@ class WC_Settings_Emails extends WC_Settings_Page {
'id' => 'woocommerce_email_from_address',
'type' => 'email',
'custom_attributes' => array(
'multiple' => 'multiple'
'multiple' => 'multiple',
),
'css' => 'min-width:300px;',
'default' => get_option( 'admin_email' ),
'autoload' => false,
'desc_tip' => true
'desc_tip' => true,
),
array( 'type' => 'sectionend', 'id' => 'email_options' ),
@ -101,7 +101,7 @@ class WC_Settings_Emails extends WC_Settings_Page {
'placeholder' => __( 'N/A', 'woocommerce' ),
'default' => '',
'autoload' => false,
'desc_tip' => true
'desc_tip' => true,
),
array(
@ -113,7 +113,7 @@ class WC_Settings_Emails extends WC_Settings_Page {
'type' => 'textarea',
'default' => get_bloginfo( 'name', 'display' ) . ' - ' . __( 'Powered by WooCommerce', 'woocommerce' ),
'autoload' => false,
'desc_tip' => true
'desc_tip' => true,
),
array(
@ -124,7 +124,7 @@ class WC_Settings_Emails extends WC_Settings_Page {
'css' => 'width:6em;',
'default' => '#96588a',
'autoload' => false,
'desc_tip' => true
'desc_tip' => true,
),
array(
@ -135,7 +135,7 @@ class WC_Settings_Emails extends WC_Settings_Page {
'css' => 'width:6em;',
'default' => '#f7f7f7',
'autoload' => false,
'desc_tip' => true
'desc_tip' => true,
),
array(
@ -146,7 +146,7 @@ class WC_Settings_Emails extends WC_Settings_Page {
'css' => 'width:6em;',
'default' => '#ffffff',
'autoload' => false,
'desc_tip' => true
'desc_tip' => true,
),
array(
@ -157,7 +157,7 @@ class WC_Settings_Emails extends WC_Settings_Page {
'css' => 'width:6em;',
'default' => '#3c3c3c',
'autoload' => false,
'desc_tip' => true
'desc_tip' => true,
),
array( 'type' => 'sectionend', 'id' => 'email_notification_settings' ),
@ -233,7 +233,7 @@ class WC_Settings_Emails extends WC_Settings_Page {
'name' => __( 'Email', 'woocommerce' ),
'email_type' => __( 'Content Type', 'woocommerce' ),
'recipient' => __( 'Recipient(s)', 'woocommerce' ),
'actions' => ''
'actions' => '',
) );
foreach ( $columns as $key => $column ) {
echo '<th class="wc-email-settings-table-' . esc_attr( $key ) . '">' . esc_html( $column ) . '</th>';

View File

@ -71,8 +71,8 @@ class WC_Settings_General extends WC_Settings_Page {
'options' => array(
'all' => __( 'Sell to All Countries', 'woocommerce' ),
'all_except' => __( 'Sell to All Countries, Except For&hellip;', 'woocommerce' ),
'specific' => __( 'Sell to Specific Countries', 'woocommerce' )
)
'specific' => __( 'Sell to Specific Countries', 'woocommerce' ),
),
),
array(
@ -81,7 +81,7 @@ class WC_Settings_General extends WC_Settings_Page {
'id' => 'woocommerce_all_except_countries',
'css' => 'min-width: 350px;',
'default' => '',
'type' => 'multi_select_countries'
'type' => 'multi_select_countries',
),
array(
@ -90,7 +90,7 @@ class WC_Settings_General extends WC_Settings_Page {
'id' => 'woocommerce_specific_allowed_countries',
'css' => 'min-width: 350px;',
'default' => '',
'type' => 'multi_select_countries'
'type' => 'multi_select_countries',
),
array(
@ -106,7 +106,7 @@ class WC_Settings_General extends WC_Settings_Page {
'all' => __( 'Ship to all countries', 'woocommerce' ),
'specific' => __( 'Ship to specific countries only', 'woocommerce' ),
'disabled' => __( 'Disable shipping &amp; shipping calculations', 'woocommerce' ),
)
),
),
array(
@ -115,7 +115,7 @@ class WC_Settings_General extends WC_Settings_Page {
'id' => 'woocommerce_specific_ship_to_countries',
'css' => '',
'default' => '',
'type' => 'multi_select_countries'
'type' => 'multi_select_countries',
),
array(
@ -138,7 +138,7 @@ class WC_Settings_General extends WC_Settings_Page {
'desc' => __( 'Enable taxes and tax calculations', 'woocommerce' ),
'id' => 'woocommerce_calc_taxes',
'default' => 'no',
'type' => 'checkbox'
'type' => 'checkbox',
),
array(
@ -146,7 +146,7 @@ class WC_Settings_General extends WC_Settings_Page {
'desc' => __( 'Enable site-wide store notice text', 'woocommerce' ),
'id' => 'woocommerce_demo_store',
'default' => 'no',
'type' => 'checkbox'
'type' => 'checkbox',
),
array(
@ -156,7 +156,7 @@ class WC_Settings_General extends WC_Settings_Page {
'default' => __( 'This is a demo store for testing purposes &mdash; no orders shall be fulfilled.', 'woocommerce' ),
'type' => 'textarea',
'css' => 'width:350px; height: 65px;',
'autoload' => false
'autoload' => false,
),
array( 'type' => 'sectionend', 'id' => 'general_options'),
@ -172,7 +172,7 @@ class WC_Settings_General extends WC_Settings_Page {
'type' => 'select',
'class' => 'wc-enhanced-select',
'desc_tip' => true,
'options' => $currency_code_options
'options' => $currency_code_options,
),
array(
@ -187,7 +187,7 @@ class WC_Settings_General extends WC_Settings_Page {
'left' => __( 'Left', 'woocommerce' ) . ' (' . get_woocommerce_currency_symbol() . '99.99)',
'right' => __( 'Right', 'woocommerce' ) . ' (99.99' . get_woocommerce_currency_symbol() . ')',
'left_space' => __( 'Left with space', 'woocommerce' ) . ' (' . get_woocommerce_currency_symbol() . ' 99.99)',
'right_space' => __( 'Right with space', 'woocommerce' ) . ' (99.99 ' . get_woocommerce_currency_symbol() . ')'
'right_space' => __( 'Right with space', 'woocommerce' ) . ' (99.99 ' . get_woocommerce_currency_symbol() . ')',
),
'desc_tip' => true,
),
@ -222,8 +222,8 @@ class WC_Settings_General extends WC_Settings_Page {
'type' => 'number',
'custom_attributes' => array(
'min' => 0,
'step' => 1
)
'step' => 1,
),
),
array( 'type' => 'sectionend', 'id' => 'pricing_options' )

View File

@ -85,7 +85,7 @@ class WC_Settings_Products extends WC_Settings_Page {
'title' => __( 'Shop & Product Pages', 'woocommerce' ),
'type' => 'title',
'desc' => '',
'id' => 'catalog_options'
'id' => 'catalog_options',
),
array(
@ -156,7 +156,7 @@ class WC_Settings_Products extends WC_Settings_Page {
'id' => 'woocommerce_cart_redirect_after_add',
'default' => 'no',
'type' => 'checkbox',
'checkboxgroup' => 'start'
'checkboxgroup' => 'start',
),
array(
@ -164,19 +164,19 @@ class WC_Settings_Products extends WC_Settings_Page {
'id' => 'woocommerce_enable_ajax_add_to_cart',
'default' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => 'end'
'checkboxgroup' => 'end',
),
array(
'type' => 'sectionend',
'id' => 'catalog_options'
'id' => 'catalog_options',
),
array(
'title' => __( 'Product Images', 'woocommerce' ),
'type' => 'title',
'desc' => sprintf( __( 'These settings affect the display and dimensions of images in your catalog - the display on the front-end will still be affected by CSS styles. After changing these settings you may need to <a target="_blank" href="%s">regenerate your thumbnails</a>.', 'woocommerce' ), 'https://wordpress.org/extend/plugins/regenerate-thumbnails/' ),
'id' => 'image_options'
'id' => 'image_options',
),
array(
@ -188,7 +188,7 @@ class WC_Settings_Products extends WC_Settings_Page {
'default' => array(
'width' => '300',
'height' => '300',
'crop' => 1
'crop' => 1,
),
'desc_tip' => true,
),
@ -202,7 +202,7 @@ class WC_Settings_Products extends WC_Settings_Page {
'default' => array(
'width' => '600',
'height' => '600',
'crop' => 1
'crop' => 1,
),
'desc_tip' => true,
),
@ -216,7 +216,7 @@ class WC_Settings_Products extends WC_Settings_Page {
'default' => array(
'width' => '180',
'height' => '180',
'crop' => 1
'crop' => 1,
),
'desc_tip' => true,
),
@ -227,12 +227,12 @@ class WC_Settings_Products extends WC_Settings_Page {
'id' => 'woocommerce_enable_lightbox',
'default' => 'yes',
'desc_tip' => __( 'Include WooCommerce\'s lightbox. Product gallery images will open in a lightbox.', 'woocommerce' ),
'type' => 'checkbox'
'type' => 'checkbox',
),
array(
'type' => 'sectionend',
'id' => 'image_options'
'id' => 'image_options',
)
));
@ -244,7 +244,7 @@ class WC_Settings_Products extends WC_Settings_Page {
'title' => __( 'Inventory', 'woocommerce' ),
'type' => 'title',
'desc' => '',
'id' => 'product_inventory_options'
'id' => 'product_inventory_options',
),
array(
@ -252,7 +252,7 @@ class WC_Settings_Products extends WC_Settings_Page {
'desc' => __( 'Enable stock management', 'woocommerce' ),
'id' => 'woocommerce_manage_stock',
'default' => 'yes',
'type' => 'checkbox'
'type' => 'checkbox',
),
array(
@ -262,11 +262,11 @@ class WC_Settings_Products extends WC_Settings_Page {
'type' => 'number',
'custom_attributes' => array(
'min' => 0,
'step' => 1
'step' => 1,
),
'css' => 'width: 80px;',
'default' => '60',
'autoload' => false
'autoload' => false,
),
array(
@ -276,7 +276,7 @@ class WC_Settings_Products extends WC_Settings_Page {
'default' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => 'start',
'autoload' => false
'autoload' => false,
),
array(
@ -285,7 +285,7 @@ class WC_Settings_Products extends WC_Settings_Page {
'default' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => 'end',
'autoload' => false
'autoload' => false,
),
array(
@ -296,7 +296,7 @@ class WC_Settings_Products extends WC_Settings_Page {
'default' => get_option( 'admin_email' ),
'css' => 'width: 250px;',
'autoload' => false,
'desc_tip' => true
'desc_tip' => true,
),
array(
@ -307,7 +307,7 @@ class WC_Settings_Products extends WC_Settings_Page {
'type' => 'number',
'custom_attributes' => array(
'min' => 0,
'step' => 1
'step' => 1,
),
'default' => '2',
'autoload' => false,
@ -322,7 +322,7 @@ class WC_Settings_Products extends WC_Settings_Page {
'type' => 'number',
'custom_attributes' => array(
'min' => 0,
'step' => 1
'step' => 1,
),
'default' => '0',
'desc_tip' => true,
@ -333,7 +333,7 @@ class WC_Settings_Products extends WC_Settings_Page {
'desc' => __( 'Hide out of stock items from the catalog', 'woocommerce' ),
'id' => 'woocommerce_hide_out_of_stock_items',
'default' => 'no',
'type' => 'checkbox'
'type' => 'checkbox',
),
array(
@ -354,7 +354,7 @@ class WC_Settings_Products extends WC_Settings_Page {
array(
'type' => 'sectionend',
'id' => 'product_inventory_options'
'id' => 'product_inventory_options',
),
));
@ -364,7 +364,7 @@ class WC_Settings_Products extends WC_Settings_Page {
array(
'title' => __( 'Downloadable Products', 'woocommerce' ),
'type' => 'title',
'id' => 'digital_download_options'
'id' => 'digital_download_options',
),
array(
@ -381,7 +381,7 @@ class WC_Settings_Products extends WC_Settings_Page {
'xsendfile' => __( 'X-Accel-Redirect/X-Sendfile', 'woocommerce' ),
'redirect' => __( 'Redirect only', 'woocommerce' ),
),
'autoload' => false
'autoload' => false,
),
array(
@ -392,7 +392,7 @@ class WC_Settings_Products extends WC_Settings_Page {
'default' => 'no',
'desc_tip' => __( 'This setting does not apply to guest purchases.', 'woocommerce' ),
'checkboxgroup' => 'start',
'autoload' => false
'autoload' => false,
),
array(
@ -402,12 +402,12 @@ class WC_Settings_Products extends WC_Settings_Page {
'default' => 'yes',
'desc_tip' => __( 'Enable this option to grant access to downloads when orders are "processing", rather than "completed".', 'woocommerce' ),
'checkboxgroup' => 'end',
'autoload' => false
'autoload' => false,
),
array(
'type' => 'sectionend',
'id' => 'digital_download_options'
'id' => 'digital_download_options',
),
));
@ -417,7 +417,7 @@ class WC_Settings_Products extends WC_Settings_Page {
array(
'title' => __( 'Measurements', 'woocommerce' ),
'type' => 'title',
'id' => 'product_measurement_options'
'id' => 'product_measurement_options',
),
array(
@ -509,7 +509,7 @@ class WC_Settings_Products extends WC_Settings_Page {
array(
'type' => 'sectionend',
'id' => 'product_rating_options'
'id' => 'product_rating_options',
),
));

View File

@ -47,7 +47,7 @@ class WC_Settings_Shipping extends WC_Settings_Page {
$sections = array(
'' => __( 'Shipping Zones', 'woocommerce' ),
'options' => __( 'Shipping Options', 'woocommerce' ),
'classes' => __( 'Shipping Classes', 'woocommerce' )
'classes' => __( 'Shipping Classes', 'woocommerce' ),
);
if ( ! defined( 'WC_INSTALLING' ) ) {
@ -83,7 +83,7 @@ class WC_Settings_Shipping extends WC_Settings_Page {
'default' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => 'start',
'autoload' => false
'autoload' => false,
),
array(
@ -92,7 +92,7 @@ class WC_Settings_Shipping extends WC_Settings_Page {
'default' => 'no',
'type' => 'checkbox',
'checkboxgroup' => 'end',
'autoload' => false
'autoload' => false,
),
array(
@ -118,7 +118,7 @@ class WC_Settings_Shipping extends WC_Settings_Page {
'id' => 'woocommerce_shipping_debug_mode',
'default' => 'no',
'type' => 'checkbox',
'autoload' => false
'autoload' => false,
),
array( 'type' => 'sectionend', 'id' => 'shipping_options' ),
@ -305,7 +305,7 @@ class WC_Settings_Shipping extends WC_Settings_Page {
'wc_shipping_classes_nonce' => wp_create_nonce( 'wc_shipping_classes_nonce' ),
'strings' => array(
'unload_confirmation_msg' => __( 'Your changed data will be lost if you leave this page without saving.', 'woocommerce' ),
'save_failed' => __( 'Your changes were not saved. Please retry.', 'woocommerce' )
'save_failed' => __( 'Your changes were not saved. Please retry.', 'woocommerce' ),
),
) );
wp_enqueue_script( 'wc-shipping-classes' );

View File

@ -53,7 +53,7 @@ class WC_Settings_Tax extends WC_Settings_Page {
public function get_sections() {
$sections = array(
'' => __( 'Tax Options', 'woocommerce' ),
'standard' => __( 'Standard Rates', 'woocommerce' )
'standard' => __( 'Standard Rates', 'woocommerce' ),
);
// Get tax classes and display as links
@ -225,7 +225,7 @@ class WC_Settings_Tax extends WC_Settings_Page {
'tax_rate_state',
'tax_rate',
'tax_rate_name',
'tax_rate_priority'
'tax_rate_priority',
);
foreach ( $tax_rate_keys as $tax_rate_key ) {

View File

@ -61,7 +61,7 @@ if ( ! defined( 'ABSPATH' ) ) {
'product.updated' => __( 'Product Updated', 'woocommerce' ),
'product.deleted' => __( 'Product Deleted', 'woocommerce' ),
'action' => __( 'Action', 'woocommerce' ),
'custom' => __( 'Custom', 'woocommerce' )
'custom' => __( 'Custom', 'woocommerce' ),
) );
foreach ( $topics as $topic_slug => $topic_name ) : ?>

View File

@ -16,7 +16,7 @@ return apply_filters( 'woocommerce_tax_settings', array(
'desc_tip' => __( 'This option is important as it will affect how you input prices. Changing it will not update existing products.', 'woocommerce' ),
'options' => array(
'yes' => __( 'Yes, I will enter prices inclusive of tax', 'woocommerce' ),
'no' => __( 'No, I will enter prices exclusive of tax', 'woocommerce' )
'no' => __( 'No, I will enter prices exclusive of tax', 'woocommerce' ),
),
),
@ -30,7 +30,7 @@ return apply_filters( 'woocommerce_tax_settings', array(
'options' => array(
'shipping' => __( 'Customer shipping address', 'woocommerce' ),
'billing' => __( 'Customer billing address', 'woocommerce' ),
'base' => __( 'Shop base address', 'woocommerce' )
'base' => __( 'Shop base address', 'woocommerce' ),
),
),
@ -60,7 +60,7 @@ return apply_filters( 'woocommerce_tax_settings', array(
'id' => 'woocommerce_tax_classes',
'css' => 'width:100%; height: 65px;',
'type' => 'textarea',
'default' => sprintf( __( 'Reduced Rate%sZero Rate', 'woocommerce' ), PHP_EOL )
'default' => sprintf( __( 'Reduced Rate%sZero Rate', 'woocommerce' ), PHP_EOL ),
),
array(
@ -72,7 +72,7 @@ return apply_filters( 'woocommerce_tax_settings', array(
'options' => array(
'incl' => __( 'Including tax', 'woocommerce' ),
'excl' => __( 'Excluding tax', 'woocommerce' ),
)
),
),
array(
@ -85,7 +85,7 @@ return apply_filters( 'woocommerce_tax_settings', array(
'incl' => __( 'Including tax', 'woocommerce' ),
'excl' => __( 'Excluding tax', 'woocommerce' ),
),
'autoload' => false
'autoload' => false,
),
array(
@ -107,7 +107,7 @@ return apply_filters( 'woocommerce_tax_settings', array(
'single' => __( 'As a single total', 'woocommerce' ),
'itemized' => __( 'Itemized', 'woocommerce' ),
),
'autoload' => false
'autoload' => false,
),
array( 'type' => 'sectionend', 'id' => 'tax_options' ),

View File

@ -26,7 +26,7 @@ if ( ! defined( 'ABSPATH' ) ) {
'' => __( '— No Change —', 'woocommerce' ),
'1' => __( 'Change to:', 'woocommerce' ),
'2' => __( 'Increase by (fixed amount or %):', 'woocommerce' ),
'3' => __( 'Decrease by (fixed amount or %):', 'woocommerce' )
'3' => __( 'Decrease by (fixed amount or %):', 'woocommerce' ),
);
foreach ($options as $key => $value) {
echo '<option value="' . esc_attr( $key ) . '">' . $value . '</option>';
@ -51,7 +51,7 @@ if ( ! defined( 'ABSPATH' ) ) {
'1' => __( 'Change to:', 'woocommerce' ),
'2' => __( 'Increase by (fixed amount or %):', 'woocommerce' ),
'3' => __( 'Decrease by (fixed amount or %):', 'woocommerce' ),
'4' => __( 'Decrease regular price by (fixed amount or %):', 'woocommerce' )
'4' => __( 'Decrease regular price by (fixed amount or %):', 'woocommerce' ),
);
foreach ( $options as $key => $value ) {
echo '<option value="' . esc_attr( $key ) . '">' . $value . '</option>';
@ -75,7 +75,7 @@ if ( ! defined( 'ABSPATH' ) ) {
'' => __( '— No Change —', 'woocommerce' ),
'taxable' => __( 'Taxable', 'woocommerce' ),
'shipping' => __( 'Shipping only', 'woocommerce' ),
'none' => _x( 'None', 'Tax status', 'woocommerce' )
'none' => _x( 'None', 'Tax status', 'woocommerce' ),
);
foreach ($options as $key => $value) {
echo '<option value="' . esc_attr( $key ) . '">' . $value . '</option>';
@ -92,7 +92,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<?php
$options = array(
'' => __( '— No Change —', 'woocommerce' ),
'standard' => __( 'Standard', 'woocommerce' )
'standard' => __( 'Standard', 'woocommerce' ),
);
$tax_classes = WC_Tax::get_tax_classes();
@ -120,7 +120,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<?php
$options = array(
'' => __( '— No Change —', 'woocommerce' ),
'1' => __( 'Change to:', 'woocommerce' )
'1' => __( 'Change to:', 'woocommerce' ),
);
foreach ( $options as $key => $value ) {
echo '<option value="' . esc_attr( $key ) . '">'. $value .'</option>';
@ -144,7 +144,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<?php
$options = array(
'' => __( '— No Change —', 'woocommerce' ),
'1' => __( 'Change to:', 'woocommerce' )
'1' => __( 'Change to:', 'woocommerce' ),
);
foreach ( $options as $key => $value ) {
echo '<option value="' . esc_attr( $key ) . '">'. $value .'</option>';
@ -186,7 +186,7 @@ if ( ! defined( 'ABSPATH' ) ) {
'visible' => __( 'Catalog &amp; search', 'woocommerce' ),
'catalog' => __( 'Catalog', 'woocommerce' ),
'search' => __( 'Search', 'woocommerce' ),
'hidden' => __( 'Hidden', 'woocommerce' )
'hidden' => __( 'Hidden', 'woocommerce' ),
);
foreach ( $options as $key => $value ) {
echo '<option value="' . esc_attr( $key ) . '">'. $value .'</option>';
@ -203,7 +203,7 @@ if ( ! defined( 'ABSPATH' ) ) {
$options = array(
'' => __( '— No Change —', 'woocommerce' ),
'yes' => __( 'Yes', 'woocommerce' ),
'no' => __( 'No', 'woocommerce' )
'no' => __( 'No', 'woocommerce' ),
);
foreach ($options as $key => $value) {
echo '<option value="' . esc_attr( $key ) . '">'. $value .'</option>';
@ -221,7 +221,7 @@ if ( ! defined( 'ABSPATH' ) ) {
$options = array(
'' => __( '— No Change —', 'woocommerce' ),
'instock' => __( 'In stock', 'woocommerce' ),
'outofstock' => __( 'Out of stock', 'woocommerce' )
'outofstock' => __( 'Out of stock', 'woocommerce' ),
);
foreach ( $options as $key => $value ) {
echo '<option value="' . esc_attr( $key ) . '">'. $value .'</option>';
@ -240,7 +240,7 @@ if ( ! defined( 'ABSPATH' ) ) {
$options = array(
'' => __( '— No Change —', 'woocommerce' ),
'yes' => __( 'Yes', 'woocommerce' ),
'no' => __( 'No', 'woocommerce' )
'no' => __( 'No', 'woocommerce' ),
);
foreach ( $options as $key => $value ) {
echo '<option value="' . esc_attr( $key ) . '">'. $value .'</option>';
@ -258,7 +258,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<?php
$options = array(
'' => __( '— No Change —', 'woocommerce' ),
'1' => __( 'Change to:', 'woocommerce' )
'1' => __( 'Change to:', 'woocommerce' ),
);
foreach ( $options as $key => $value ) {
echo '<option value="' . esc_attr( $key ) . '">'. $value .'</option>';
@ -281,7 +281,7 @@ if ( ! defined( 'ABSPATH' ) ) {
'' => __( '— No Change —', 'woocommerce' ),
'no' => __( 'Do not allow', 'woocommerce' ),
'notify' => __( 'Allow, but notify customer', 'woocommerce' ),
'yes' => __( 'Allow', 'woocommerce' )
'yes' => __( 'Allow', 'woocommerce' ),
);
foreach ( $options as $key => $value ) {
echo '<option value="' . esc_attr( $key ) . '">'. $value .'</option>';
@ -301,7 +301,7 @@ if ( ! defined( 'ABSPATH' ) ) {
$options = array(
'' => __( '— No Change —', 'woocommerce' ),
'yes' => __( 'Yes', 'woocommerce' ),
'no' => __( 'No', 'woocommerce' )
'no' => __( 'No', 'woocommerce' ),
);
foreach ( $options as $key => $value ) {
echo '<option value="' . esc_attr( $key ) . '">' . esc_html( $value ) . '</option>';

View File

@ -54,7 +54,7 @@ if ( ! defined( 'ABSPATH' ) ) {
$options = array(
'taxable' => __( 'Taxable', 'woocommerce' ),
'shipping' => __( 'Shipping only', 'woocommerce' ),
'none' => _x( 'None', 'Tax status', 'woocommerce' )
'none' => _x( 'None', 'Tax status', 'woocommerce' ),
);
foreach ( $options as $key => $value ) {
echo '<option value="' . esc_attr( $key ) . '">' . $value . '</option>';
@ -70,7 +70,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<select class="tax_class" name="_tax_class">
<?php
$options = array(
'' => __( 'Standard', 'woocommerce' )
'' => __( 'Standard', 'woocommerce' ),
);
$tax_classes = WC_Tax::get_tax_classes();
@ -143,7 +143,7 @@ if ( ! defined( 'ABSPATH' ) ) {
'visible' => __( 'Catalog &amp; search', 'woocommerce' ),
'catalog' => __( 'Catalog', 'woocommerce' ),
'search' => __( 'Search', 'woocommerce' ),
'hidden' => __( 'Hidden', 'woocommerce' )
'hidden' => __( 'Hidden', 'woocommerce' ),
) );
foreach ( $options as $key => $value ) {
echo '<option value="' . esc_attr( $key ) . '">'. $value .'</option>';
@ -164,7 +164,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<?php
$options = array(
'instock' => __( 'In stock', 'woocommerce' ),
'outofstock' => __( 'Out of stock', 'woocommerce' )
'outofstock' => __( 'Out of stock', 'woocommerce' ),
);
foreach ( $options as $key => $value ) {
echo '<option value="' . esc_attr( $key ) .'">'. $value .'</option>';
@ -200,7 +200,7 @@ if ( ! defined( 'ABSPATH' ) ) {
$options = array(
'no' => __( 'Do not allow', 'woocommerce' ),
'notify' => __( 'Allow, but notify customer', 'woocommerce' ),
'yes' => __( 'Allow', 'woocommerce' )
'yes' => __( 'Allow', 'woocommerce' ),
);
foreach ( $options as $key => $value ) {
echo '<option value="' . esc_attr( $key ) . '">'. $value .'</option>';

View File

@ -111,7 +111,7 @@ function wc_create_page( $slug, $option = '', $page_title = '', $page_content =
'post_title' => $page_title,
'post_content' => $page_content,
'post_parent' => $post_parent,
'comment_status' => 'closed'
'comment_status' => 'closed',
);
$page_id = wp_insert_post( $page_data );
}

View File

@ -385,7 +385,7 @@ class WC_REST_Coupons_Controller extends WC_REST_Posts_Controller {
'minimum_amount' => '',
'maximum_amount' => '',
'email_restrictions' => array(),
'description' => ''
'description' => '',
);
$data = wp_parse_args( $data, $defaults );

View File

@ -193,7 +193,7 @@ class WC_REST_Products_Controller extends WC_REST_Posts_Controller {
$args['meta_query'][] = array(
'key' => '_sku',
'value' => $request['sku'],
'compare' => '='
'compare' => '=',
);
$args['post_type'] = array( 'product', 'product_variation' );
@ -1107,7 +1107,7 @@ class WC_REST_Products_Controller extends WC_REST_Posts_Controller {
'meta_key' => '_price',
'posts_per_page' => 1,
'post_type' => 'product',
'fields' => 'ids'
'fields' => 'ids',
) );
if ( $children_by_price ) {
@ -2396,7 +2396,7 @@ class WC_REST_Products_Controller extends WC_REST_Posts_Controller {
'visible' => array(
'description' => __( 'If the variation is visible.', 'woocommerce' ),
'type' => 'boolean',
'context' => array( 'view', 'edit' )
'context' => array( 'view', 'edit' ),
),
'virtual' => array(
'description' => __( 'If the variation is virtual.', 'woocommerce' ),

View File

@ -64,7 +64,7 @@ class WC_REST_Report_Top_Sellers_Controller extends WC_REST_Report_Sales_Control
'order_item_type' => 'line_item',
'function' => 'SUM',
'name' => 'order_item_qty',
)
),
),
'order_by' => 'order_item_qty DESC',
'group_by' => 'product_id',

View File

@ -281,7 +281,7 @@ class WC_REST_System_Status_Controller extends WC_REST_Controller {
'type' => 'array',
'context' => array( 'view', 'edit' ),
),
)
),
),
'active_plugins' => array(
'description' => __( 'Active Plugins', 'woocommerce' ),
@ -355,7 +355,7 @@ class WC_REST_System_Status_Controller extends WC_REST_Controller {
'format' => 'uri',
'context' => array( 'view', 'edit' ),
),
)
),
),
'settings' => array(
'description' => __( 'Settings', 'woocommerce' ),
@ -412,14 +412,14 @@ class WC_REST_System_Status_Controller extends WC_REST_Controller {
'type' => 'array',
'context' => array( 'view', 'edit' ),
),
)
),
),
'pages' => array(
'description' => __( 'WooCommerce Pages', 'woocommerce' ),
'type' => 'array',
'context' => array( 'view', 'edit' ),
),
)
),
);
return $this->add_additional_fields_schema( $schema );
@ -469,8 +469,8 @@ class WC_REST_System_Status_Controller extends WC_REST_Controller {
'user-agent' => 'WooCommerce/' . WC()->version,
'httpversion' => '1.1',
'body' => array(
'cmd' => '_notify-validate'
)
'cmd' => '_notify-validate',
),
) );
$post_response_successful = false;
if ( ! is_wp_error( $post_response ) && $post_response['response']['code'] >= 200 && $post_response['response']['code'] < 300 ) {
@ -610,7 +610,7 @@ class WC_REST_System_Status_Controller extends WC_REST_Controller {
'fields' => array(
'sections' => false,
'tags' => false,
)
),
) );
if ( is_object( $api ) && ! is_wp_error( $api ) ) {

View File

@ -150,7 +150,7 @@ class WC_REST_System_Status_Tools_Controller extends WC_REST_Controller {
'name' => __( 'Reset Usage Tracking Settings', 'woocommerce' ),
'button' => __( 'Reset usage tracking settings', 'woocommerce' ),
'desc' => __( 'This will reset your usage tracking settings, causing it to show the opt-in banner again and not sending any data.', 'woocommerce' ),
)
),
);
return apply_filters( 'woocommerce_debug_tools', $tools );

View File

@ -315,7 +315,7 @@ class WC_API_Orders extends WC_API_Resource {
$args = array(
'post_id' => $id,
'approve' => 'approve',
'type' => 'order_note'
'type' => 'order_note',
);
remove_filter( 'comments_clauses', array( 'WC_Comments', 'exclude_order_comments' ), 10, 1 );
@ -352,7 +352,7 @@ class WC_API_Orders extends WC_API_Resource {
$query_args = array(
'fields' => 'ids',
'post_type' => 'shop_order',
'post_status' => array_keys( wc_get_order_statuses() )
'post_status' => array_keys( wc_get_order_statuses() ),
);
// add status argument

View File

@ -89,28 +89,28 @@ class WC_API_Reports extends WC_API_Resource {
'_order_total' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'sales'
'name' => 'sales',
),
'_order_tax' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'tax'
'name' => 'tax',
),
'_order_shipping_tax' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'shipping_tax'
'name' => 'shipping_tax',
),
'_order_shipping' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'shipping'
'name' => 'shipping',
),
'ID' => array(
'type' => 'post_data',
'function' => 'COUNT',
'name' => 'order_count'
)
'name' => 'order_count',
),
),
'filter_range' => true,
) );
@ -122,8 +122,8 @@ class WC_API_Reports extends WC_API_Resource {
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => 'SUM',
'name' => 'order_item_qty'
)
'name' => 'order_item_qty',
),
),
'query_type' => 'get_var',
'filter_range' => true,
@ -136,14 +136,14 @@ class WC_API_Reports extends WC_API_Resource {
'type' => 'order_item_meta',
'order_item_type' => 'coupon',
'function' => 'SUM',
'name' => 'discount_amount'
)
'name' => 'discount_amount',
),
),
'where' => array(
array(
'key' => 'order_item_type',
'value' => 'coupon',
'operator' => '='
'operator' => '=',
)
),
'query_type' => 'get_var',
@ -173,22 +173,22 @@ class WC_API_Reports extends WC_API_Resource {
'_order_total' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'total_sales'
'name' => 'total_sales',
),
'_order_shipping' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'total_shipping'
'name' => 'total_shipping',
),
'_order_tax' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'total_tax'
'name' => 'total_tax',
),
'_order_shipping_tax' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'total_shipping_tax'
'name' => 'total_shipping_tax',
),
'ID' => array(
'type' => 'post_data',
@ -199,7 +199,7 @@ class WC_API_Reports extends WC_API_Resource {
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
'name' => 'post_date',
),
),
'group_by' => $this->report->group_by_query,
@ -215,19 +215,19 @@ class WC_API_Reports extends WC_API_Resource {
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => 'SUM',
'name' => 'order_item_count'
'name' => 'order_item_count',
),
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
'name' => 'post_date',
),
),
'where' => array(
array(
'key' => 'order_item_type',
'value' => 'line_item',
'operator' => '='
'operator' => '=',
)
),
'group_by' => $this->report->group_by_query,
@ -243,19 +243,19 @@ class WC_API_Reports extends WC_API_Resource {
'type' => 'order_item_meta',
'order_item_type' => 'coupon',
'function' => 'SUM',
'name' => 'discount_amount'
'name' => 'discount_amount',
),
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
'name' => 'post_date',
),
),
'where' => array(
array(
'key' => 'order_item_type',
'value' => 'coupon',
'operator' => '='
'operator' => '=',
)
),
'group_by' => $this->report->group_by_query . ', order_item_name',
@ -376,14 +376,14 @@ class WC_API_Reports extends WC_API_Resource {
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => '',
'name' => 'product_id'
'name' => 'product_id',
),
'_qty' => array(
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => 'SUM',
'name' => 'order_item_qty'
)
'name' => 'order_item_qty',
),
),
'order_by' => 'order_item_qty DESC',
'group_by' => 'product_id',

View File

@ -255,7 +255,7 @@ class WC_API_XML_Handler implements WC_API_Handler {
'upsell_ids' => 'upsell_id',
'cross_sell_ids' => 'cross_sell_id',
'categories' => 'category',
'tags' => 'tag'
'tags' => 'tag',
);
foreach ( $fields_to_fix as $parent_field_name => $child_field_name ) {

View File

@ -258,7 +258,7 @@ class WC_API_Coupons extends WC_API_Resource {
'minimum_amount' => '',
'maximum_amount' => '',
'customer_emails' => array(),
'description' => ''
'description' => '',
);
$coupon_data = wp_parse_args( $data, $defaults );
@ -274,7 +274,7 @@ class WC_API_Coupons extends WC_API_Resource {
'post_status' => 'publish',
'post_author' => get_current_user_id(),
'post_type' => 'shop_coupon',
'post_excerpt' => $coupon_data['description']
'post_excerpt' => $coupon_data['description'],
);
$id = wp_insert_post( $new_coupon, true );
@ -549,7 +549,7 @@ class WC_API_Coupons extends WC_API_Resource {
if ( is_wp_error( $edit ) ) {
$coupons[] = array(
'id' => $coupon_id,
'error' => array( 'code' => $edit->get_error_code(), 'message' => $edit->get_error_message() )
'error' => array( 'code' => $edit->get_error_code(), 'message' => $edit->get_error_message() ),
);
} else {
$coupons[] = $edit['coupon'];
@ -563,7 +563,7 @@ class WC_API_Coupons extends WC_API_Resource {
if ( is_wp_error( $new ) ) {
$coupons[] = array(
'id' => $coupon_id,
'error' => array( 'code' => $new->get_error_code(), 'message' => $new->get_error_message() )
'error' => array( 'code' => $new->get_error_code(), 'message' => $new->get_error_message() ),
);
} else {
$coupons[] = $new['coupon'];

View File

@ -816,7 +816,7 @@ class WC_API_Customers extends WC_API_Resource {
if ( is_wp_error( $edit ) ) {
$customers[] = array(
'id' => $customer_id,
'error' => array( 'code' => $edit->get_error_code(), 'message' => $edit->get_error_message() )
'error' => array( 'code' => $edit->get_error_code(), 'message' => $edit->get_error_message() ),
);
} else {
$customers[] = $edit['customer'];
@ -830,7 +830,7 @@ class WC_API_Customers extends WC_API_Resource {
if ( is_wp_error( $new ) ) {
$customers[] = array(
'id' => $customer_id,
'error' => array( 'code' => $new->get_error_code(), 'message' => $new->get_error_message() )
'error' => array( 'code' => $new->get_error_code(), 'message' => $new->get_error_message() ),
);
} else {
$customers[] = $new['customer'];

View File

@ -668,7 +668,7 @@ class WC_API_Orders extends WC_API_Resource {
$query_args = array(
'fields' => 'ids',
'post_type' => $this->post_type,
'post_status' => array_keys( wc_get_order_statuses() )
'post_status' => array_keys( wc_get_order_statuses() ),
);
// add status argument
@ -1198,7 +1198,7 @@ class WC_API_Orders extends WC_API_Resource {
$args = array(
'post_id' => $order_id,
'approve' => 'approve',
'type' => 'order_note'
'type' => 'order_note',
);
remove_filter( 'comments_clauses', array( 'WC_Comments', 'exclude_order_comments' ), 10, 1 );
@ -1540,7 +1540,7 @@ class WC_API_Orders extends WC_API_Resource {
'created_at' => $this->server->format_datetime( get_gmt_from_date( date( 'Y-m-d H:i:s', $refund->get_date_created() ) ) ),
'amount' => wc_format_decimal( $refund->get_amount(), 2 ),
'reason' => $refund->get_reason(),
'line_items' => $line_items
'line_items' => $line_items,
);
return array( 'order_refund' => apply_filters( 'woocommerce_api_order_refund_response', $order_refund, $id, $fields, $refund, $order_id, $this ) );
@ -1783,7 +1783,7 @@ class WC_API_Orders extends WC_API_Resource {
if ( is_wp_error( $edit ) ) {
$orders[] = array(
'id' => $order_id,
'error' => array( 'code' => $edit->get_error_code(), 'message' => $edit->get_error_message() )
'error' => array( 'code' => $edit->get_error_code(), 'message' => $edit->get_error_message() ),
);
} else {
$orders[] = $edit['order'];
@ -1797,7 +1797,7 @@ class WC_API_Orders extends WC_API_Resource {
if ( is_wp_error( $new ) ) {
$orders[] = array(
'id' => $order_id,
'error' => array( 'code' => $new->get_error_code(), 'message' => $new->get_error_message() )
'error' => array( 'code' => $new->get_error_code(), 'message' => $new->get_error_message() ),
);
} else {
$orders[] = $new['order'];

View File

@ -518,7 +518,7 @@ class WC_API_Products extends WC_API_Resource {
}
$filter = array_merge( $filter, array(
'in' => implode( ',', $order_ids )
'in' => implode( ',', $order_ids ),
) );
$orders = WC()->api->WC_API_Orders->get_orders( $fields, $filter, $status, $page );
@ -601,7 +601,7 @@ class WC_API_Products extends WC_API_Resource {
'description' => $term->description,
'display' => $display_type ? $display_type : 'default',
'image' => $image ? esc_url( $image ) : '',
'count' => intval( $term->count )
'count' => intval( $term->count ),
);
return array( 'product_category' => apply_filters( 'woocommerce_api_product_category_response', $product_category, $id, $fields, $term, $this ) );
@ -656,7 +656,7 @@ class WC_API_Products extends WC_API_Resource {
$query_args['meta_query'][] = array(
'key' => '_sku',
'value' => $args['sku'],
'compare' => '='
'compare' => '=',
);
$query_args['post_type'] = array( 'product', 'product_variation' );
@ -940,7 +940,7 @@ class WC_API_Products extends WC_API_Resource {
'position' => isset( $attribute['position'] ) ? (string) absint( $attribute['position'] ) : '0',
'is_visible' => ( isset( $attribute['visible'] ) && $attribute['visible'] ) ? 1 : 0,
'is_variation' => ( isset( $attribute['variation'] ) && $attribute['variation'] ) ? 1 : 0,
'is_taxonomy' => $is_taxonomy
'is_taxonomy' => $is_taxonomy,
);
}
@ -961,7 +961,7 @@ class WC_API_Products extends WC_API_Resource {
'position' => isset( $attribute['position'] ) ? (string) absint( $attribute['position'] ) : '0',
'is_visible' => ( isset( $attribute['visible'] ) && $attribute['visible'] ) ? 1 : 0,
'is_variation' => ( isset( $attribute['variation'] ) && $attribute['variation'] ) ? 1 : 0,
'is_taxonomy' => $is_taxonomy
'is_taxonomy' => $is_taxonomy,
);
}
}
@ -1044,7 +1044,7 @@ class WC_API_Products extends WC_API_Resource {
'meta_key' => '_price',
'posts_per_page' => 1,
'post_type' => 'product',
'fields' => 'ids'
'fields' => 'ids',
) );
if ( $children_by_price ) {
@ -1273,7 +1273,7 @@ class WC_API_Products extends WC_API_Resource {
'post_author' => get_current_user_id(),
'post_parent' => $id,
'post_type' => 'product_variation',
'menu_order' => $menu_order
'menu_order' => $menu_order,
);
$variation_id = wp_insert_post( $new_variation );
@ -1631,7 +1631,7 @@ class WC_API_Products extends WC_API_Resource {
$files[ md5( $file_url ) ] = array(
'name' => $file_name,
'file' => $file_url
'file' => $file_url,
);
}
@ -1817,7 +1817,7 @@ class WC_API_Products extends WC_API_Resource {
// Get the file
$response = wp_safe_remote_get( $image_url, array(
'timeout' => 10
'timeout' => 10,
) );
if ( is_wp_error( $response ) ) {
@ -1896,7 +1896,7 @@ class WC_API_Products extends WC_API_Resource {
'guid' => $upload['url'],
'post_parent' => $id,
'post_title' => $title,
'post_content' => $content
'post_content' => $content,
);
$attachment_id = wp_insert_attachment( $attachment, $upload['file'], $id );
@ -2015,7 +2015,7 @@ class WC_API_Products extends WC_API_Resource {
'slug' => wc_attribute_taxonomy_name( $attribute->attribute_name ),
'type' => $attribute->attribute_type,
'order_by' => $attribute->attribute_orderby,
'has_archives' => (bool) $attribute->attribute_public
'has_archives' => (bool) $attribute->attribute_public,
);
}
@ -2065,7 +2065,7 @@ class WC_API_Products extends WC_API_Resource {
'slug' => wc_attribute_taxonomy_name( $attribute->attribute_name ),
'type' => $attribute->attribute_type,
'order_by' => $attribute->attribute_orderby,
'has_archives' => (bool) $attribute->attribute_public
'has_archives' => (bool) $attribute->attribute_public,
);
return array( 'product_attribute' => apply_filters( 'woocommerce_api_product_attribute_response', $product_attribute, $id, $fields, $attribute, $this ) );
@ -2167,7 +2167,7 @@ class WC_API_Products extends WC_API_Resource {
'attribute_name' => $data['slug'],
'attribute_type' => $data['type'],
'attribute_orderby' => $data['order_by'],
'attribute_public' => isset( $data['has_archives'] ) && true === $data['has_archives'] ? 1 : 0
'attribute_public' => isset( $data['has_archives'] ) && true === $data['has_archives'] ? 1 : 0,
),
array( '%s', '%s', '%s', '%s', '%d' )
);
@ -2250,7 +2250,7 @@ class WC_API_Products extends WC_API_Resource {
'attribute_name' => $attribute_slug,
'attribute_type' => $attribute_type,
'attribute_orderby' => $attribute_order_by,
'attribute_public' => $attribute_public
'attribute_public' => $attribute_public,
),
array( 'attribute_id' => $id ),
array( '%s', '%s', '%s', '%s', '%d' ),
@ -2427,7 +2427,7 @@ class WC_API_Products extends WC_API_Resource {
$products[] = array(
'id' => $product_id,
'sku' => $product_sku,
'error' => array( 'code' => $edit->get_error_code(), 'message' => $edit->get_error_message() )
'error' => array( 'code' => $edit->get_error_code(), 'message' => $edit->get_error_message() ),
);
} else {
$products[] = $edit['product'];
@ -2442,7 +2442,7 @@ class WC_API_Products extends WC_API_Resource {
$products[] = array(
'id' => $product_id,
'sku' => $product_sku,
'error' => array( 'code' => $new->get_error_code(), 'message' => $new->get_error_message() )
'error' => array( 'code' => $new->get_error_code(), 'message' => $new->get_error_message() ),
);
} else {
$products[] = $new['product'];

View File

@ -223,14 +223,14 @@ class WC_API_Reports extends WC_API_Resource {
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => '',
'name' => 'product_id'
'name' => 'product_id',
),
'_qty' => array(
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => 'SUM',
'name' => 'order_item_qty'
)
'name' => 'order_item_qty',
),
),
'order_by' => 'order_item_qty DESC',
'group_by' => 'product_id',

View File

@ -293,7 +293,7 @@ class WC_API_Webhooks extends WC_API_Resource {
// update user ID
$webhook_data = array(
'ID' => $webhook->id,
'post_author' => get_current_user_id()
'post_author' => get_current_user_id(),
);
// update name

View File

@ -258,7 +258,7 @@ class WC_API_Coupons extends WC_API_Resource {
'minimum_amount' => '',
'maximum_amount' => '',
'customer_emails' => array(),
'description' => ''
'description' => '',
);
$coupon_data = wp_parse_args( $data, $defaults );
@ -274,7 +274,7 @@ class WC_API_Coupons extends WC_API_Resource {
'post_status' => 'publish',
'post_author' => get_current_user_id(),
'post_type' => 'shop_coupon',
'post_excerpt' => $coupon_data['description']
'post_excerpt' => $coupon_data['description'],
);
$id = wp_insert_post( $new_coupon, true );
@ -549,7 +549,7 @@ class WC_API_Coupons extends WC_API_Resource {
if ( is_wp_error( $edit ) ) {
$coupons[] = array(
'id' => $coupon_id,
'error' => array( 'code' => $edit->get_error_code(), 'message' => $edit->get_error_message() )
'error' => array( 'code' => $edit->get_error_code(), 'message' => $edit->get_error_message() ),
);
} else {
$coupons[] = $edit['coupon'];
@ -563,7 +563,7 @@ class WC_API_Coupons extends WC_API_Resource {
if ( is_wp_error( $new ) ) {
$coupons[] = array(
'id' => $coupon_id,
'error' => array( 'code' => $new->get_error_code(), 'message' => $new->get_error_message() )
'error' => array( 'code' => $new->get_error_code(), 'message' => $new->get_error_message() ),
);
} else {
$coupons[] = $new['coupon'];

View File

@ -805,7 +805,7 @@ class WC_API_Customers extends WC_API_Resource {
if ( is_wp_error( $edit ) ) {
$customers[] = array(
'id' => $customer_id,
'error' => array( 'code' => $edit->get_error_code(), 'message' => $edit->get_error_message() )
'error' => array( 'code' => $edit->get_error_code(), 'message' => $edit->get_error_message() ),
);
} else {
$customers[] = $edit['customer'];
@ -819,7 +819,7 @@ class WC_API_Customers extends WC_API_Resource {
if ( is_wp_error( $new ) ) {
$customers[] = array(
'id' => $customer_id,
'error' => array( 'code' => $new->get_error_code(), 'message' => $new->get_error_message() )
'error' => array( 'code' => $new->get_error_code(), 'message' => $new->get_error_message() ),
);
} else {
$customers[] = $new['customer'];

View File

@ -707,7 +707,7 @@ class WC_API_Orders extends WC_API_Resource {
$query_args = array(
'fields' => 'ids',
'post_type' => $this->post_type,
'post_status' => array_keys( wc_get_order_statuses() )
'post_status' => array_keys( wc_get_order_statuses() ),
);
// add status argument
@ -724,7 +724,7 @@ class WC_API_Orders extends WC_API_Resource {
array(
'key' => '_customer_user',
'value' => absint( $args['customer_id'] ),
'compare' => '='
'compare' => '=',
)
);
}
@ -1243,7 +1243,7 @@ class WC_API_Orders extends WC_API_Resource {
$args = array(
'post_id' => $order_id,
'approve' => 'approve',
'type' => 'order_note'
'type' => 'order_note',
);
remove_filter( 'comments_clauses', array( 'WC_Comments', 'exclude_order_comments' ), 10, 1 );
@ -1585,7 +1585,7 @@ class WC_API_Orders extends WC_API_Resource {
'created_at' => $this->server->format_datetime( get_gmt_from_date( date( 'Y-m-d H:i:s', $refund->get_date_created() ) ) ),
'amount' => wc_format_decimal( $refund->get_amount(), 2 ),
'reason' => $refund->get_reason(),
'line_items' => $line_items
'line_items' => $line_items,
);
return array( 'order_refund' => apply_filters( 'woocommerce_api_order_refund_response', $order_refund, $id, $fields, $refund, $order_id, $this ) );
@ -1828,7 +1828,7 @@ class WC_API_Orders extends WC_API_Resource {
if ( is_wp_error( $edit ) ) {
$orders[] = array(
'id' => $order_id,
'error' => array( 'code' => $edit->get_error_code(), 'message' => $edit->get_error_message() )
'error' => array( 'code' => $edit->get_error_code(), 'message' => $edit->get_error_message() ),
);
} else {
$orders[] = $edit['order'];
@ -1842,7 +1842,7 @@ class WC_API_Orders extends WC_API_Resource {
if ( is_wp_error( $new ) ) {
$orders[] = array(
'id' => $order_id,
'error' => array( 'code' => $new->get_error_code(), 'message' => $new->get_error_message() )
'error' => array( 'code' => $new->get_error_code(), 'message' => $new->get_error_message() ),
);
} else {
$orders[] = $new['order'];

View File

@ -573,7 +573,7 @@ class WC_API_Products extends WC_API_Resource {
}
$filter = array_merge( $filter, array(
'in' => implode( ',', $order_ids )
'in' => implode( ',', $order_ids ),
) );
$orders = WC()->api->WC_API_Orders->get_orders( $fields, $filter, $status, $page );
@ -656,7 +656,7 @@ class WC_API_Products extends WC_API_Resource {
'description' => $term->description,
'display' => $display_type ? $display_type : 'default',
'image' => $image ? esc_url( $image ) : '',
'count' => intval( $term->count )
'count' => intval( $term->count ),
);
return array( 'product_category' => apply_filters( 'woocommerce_api_product_category_response', $product_category, $id, $fields, $term, $this ) );
@ -911,7 +911,7 @@ class WC_API_Products extends WC_API_Resource {
'name' => $term->name,
'slug' => $term->slug,
'description' => $term->description,
'count' => intval( $term->count )
'count' => intval( $term->count ),
);
return array( 'product_tag' => apply_filters( 'woocommerce_api_product_tag_response', $tag, $id, $fields, $term, $this ) );
@ -1098,7 +1098,7 @@ class WC_API_Products extends WC_API_Resource {
$query_args['meta_query'][] = array(
'key' => '_sku',
'value' => $args['sku'],
'compare' => '='
'compare' => '=',
);
$query_args['post_type'] = array( 'product', 'product_variation' );
@ -1425,7 +1425,7 @@ class WC_API_Products extends WC_API_Resource {
'position' => isset( $attribute['position'] ) ? (string) absint( $attribute['position'] ) : '0',
'is_visible' => ( isset( $attribute['visible'] ) && $attribute['visible'] ) ? 1 : 0,
'is_variation' => ( isset( $attribute['variation'] ) && $attribute['variation'] ) ? 1 : 0,
'is_taxonomy' => $is_taxonomy
'is_taxonomy' => $is_taxonomy,
);
}
@ -1446,7 +1446,7 @@ class WC_API_Products extends WC_API_Resource {
'position' => isset( $attribute['position'] ) ? (string) absint( $attribute['position'] ) : '0',
'is_visible' => ( isset( $attribute['visible'] ) && $attribute['visible'] ) ? 1 : 0,
'is_variation' => ( isset( $attribute['variation'] ) && $attribute['variation'] ) ? 1 : 0,
'is_taxonomy' => $is_taxonomy
'is_taxonomy' => $is_taxonomy,
);
}
}
@ -1529,7 +1529,7 @@ class WC_API_Products extends WC_API_Resource {
'meta_key' => '_price',
'posts_per_page' => 1,
'post_type' => 'product',
'fields' => 'ids'
'fields' => 'ids',
) );
if ( $children_by_price ) {
@ -1768,7 +1768,7 @@ class WC_API_Products extends WC_API_Resource {
'post_author' => get_current_user_id(),
'post_parent' => $id,
'post_type' => 'product_variation',
'menu_order' => $menu_order
'menu_order' => $menu_order,
);
$variation_id = wp_insert_post( $new_variation );
@ -2153,7 +2153,7 @@ class WC_API_Products extends WC_API_Resource {
$files[ md5( $file_url ) ] = array(
'name' => $file_name,
'file' => $file_url
'file' => $file_url,
);
}
@ -2373,7 +2373,7 @@ class WC_API_Products extends WC_API_Resource {
// Get the file.
$response = wp_safe_remote_get( $image_url, array(
'timeout' => 10
'timeout' => 10,
) );
if ( is_wp_error( $response ) ) {
@ -2477,7 +2477,7 @@ class WC_API_Products extends WC_API_Resource {
'guid' => $upload['url'],
'post_parent' => $id,
'post_title' => $title,
'post_content' => $content
'post_content' => $content,
);
$attachment_id = wp_insert_attachment( $attachment, $upload['file'], $id );
@ -2596,7 +2596,7 @@ class WC_API_Products extends WC_API_Resource {
'slug' => wc_attribute_taxonomy_name( $attribute->attribute_name ),
'type' => $attribute->attribute_type,
'order_by' => $attribute->attribute_orderby,
'has_archives' => (bool) $attribute->attribute_public
'has_archives' => (bool) $attribute->attribute_public,
);
}
@ -2646,7 +2646,7 @@ class WC_API_Products extends WC_API_Resource {
'slug' => wc_attribute_taxonomy_name( $attribute->attribute_name ),
'type' => $attribute->attribute_type,
'order_by' => $attribute->attribute_orderby,
'has_archives' => (bool) $attribute->attribute_public
'has_archives' => (bool) $attribute->attribute_public,
);
return array( 'product_attribute' => apply_filters( 'woocommerce_api_product_attribute_response', $product_attribute, $id, $fields, $attribute, $this ) );
@ -2748,7 +2748,7 @@ class WC_API_Products extends WC_API_Resource {
'attribute_name' => $data['slug'],
'attribute_type' => $data['type'],
'attribute_orderby' => $data['order_by'],
'attribute_public' => isset( $data['has_archives'] ) && true === $data['has_archives'] ? 1 : 0
'attribute_public' => isset( $data['has_archives'] ) && true === $data['has_archives'] ? 1 : 0,
),
array( '%s', '%s', '%s', '%s', '%d' )
);
@ -2832,7 +2832,7 @@ class WC_API_Products extends WC_API_Resource {
'attribute_name' => $attribute_slug,
'attribute_type' => $attribute_type,
'attribute_orderby' => $attribute_order_by,
'attribute_public' => $attribute_public
'attribute_public' => $attribute_public,
),
array( 'attribute_id' => $id ),
array( '%s', '%s', '%s', '%s', '%d' ),
@ -3255,7 +3255,7 @@ class WC_API_Products extends WC_API_Resource {
$products[] = array(
'id' => $product_id,
'sku' => $product_sku,
'error' => array( 'code' => $edit->get_error_code(), 'message' => $edit->get_error_message() )
'error' => array( 'code' => $edit->get_error_code(), 'message' => $edit->get_error_message() ),
);
} else {
$products[] = $edit['product'];
@ -3270,7 +3270,7 @@ class WC_API_Products extends WC_API_Resource {
$products[] = array(
'id' => $product_id,
'sku' => $product_sku,
'error' => array( 'code' => $new->get_error_code(), 'message' => $new->get_error_message() )
'error' => array( 'code' => $new->get_error_code(), 'message' => $new->get_error_message() ),
);
} else {
$products[] = $new['product'];
@ -3348,7 +3348,7 @@ class WC_API_Products extends WC_API_Resource {
'slug' => $term->slug,
'parent' => $term->parent,
'description' => $term->description,
'count' => intval( $term->count )
'count' => intval( $term->count ),
);
return array( 'product_shipping_class' => apply_filters( 'woocommerce_api_product_shipping_class_response', $product_shipping_class, $id, $fields, $term, $this ) );

View File

@ -223,14 +223,14 @@ class WC_API_Reports extends WC_API_Resource {
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => '',
'name' => 'product_id'
'name' => 'product_id',
),
'_qty' => array(
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => 'SUM',
'name' => 'order_item_qty'
)
'name' => 'order_item_qty',
),
),
'order_by' => 'order_item_qty DESC',
'group_by' => 'product_id',

View File

@ -147,7 +147,7 @@ class WC_API_Taxes extends WC_API_Resource {
'compound' => (bool) $tax['tax_rate_compound'],
'shipping' => (bool) $tax['tax_rate_shipping'],
'order' => (int) $tax['tax_rate_order'],
'class' => $tax['tax_rate_class'] ? $tax['tax_rate_class'] : 'standard'
'class' => $tax['tax_rate_class'] ? $tax['tax_rate_class'] : 'standard',
);
// Get locales from a tax rate
@ -436,7 +436,7 @@ class WC_API_Taxes extends WC_API_Resource {
return array(
'results' => $results,
'headers' => $headers
'headers' => $headers,
);
}
@ -482,7 +482,7 @@ class WC_API_Taxes extends WC_API_Resource {
if ( is_wp_error( $edit ) ) {
$taxes[] = array(
'id' => $tax_id,
'error' => array( 'code' => $edit->get_error_code(), 'message' => $edit->get_error_message() )
'error' => array( 'code' => $edit->get_error_code(), 'message' => $edit->get_error_message() ),
);
} else {
$taxes[] = $edit['tax'];
@ -496,7 +496,7 @@ class WC_API_Taxes extends WC_API_Resource {
if ( is_wp_error( $new ) ) {
$taxes[] = array(
'id' => $tax_id,
'error' => array( 'code' => $new->get_error_code(), 'message' => $new->get_error_message() )
'error' => array( 'code' => $new->get_error_code(), 'message' => $new->get_error_message() ),
);
} else {
$taxes[] = $new['tax'];
@ -531,7 +531,7 @@ class WC_API_Taxes extends WC_API_Resource {
// Add standard class
$tax_classes[] = array(
'slug' => 'standard',
'name' => __( 'Standard Rate', 'woocommerce' )
'name' => __( 'Standard Rate', 'woocommerce' ),
);
$classes = WC_Tax::get_tax_classes();
@ -539,7 +539,7 @@ class WC_API_Taxes extends WC_API_Resource {
foreach ( $classes as $class ) {
$tax_classes[] = apply_filters( 'woocommerce_api_tax_class_response', array(
'slug' => sanitize_title( $class ),
'name' => $class
'name' => $class,
), $class, $fields, $this );
}
@ -605,8 +605,8 @@ class WC_API_Taxes extends WC_API_Resource {
return array(
'tax_class' => array(
'slug' => $slug,
'name' => $name
)
'name' => $name,
),
);
} catch ( WC_API_Exception $e ) {
return new WP_Error( $e->getErrorCode(), $e->getMessage(), array( 'status' => $e->getCode() ) );

View File

@ -293,7 +293,7 @@ class WC_API_Webhooks extends WC_API_Resource {
// update user ID
$webhook_data = array(
'ID' => $webhook->id,
'post_author' => get_current_user_id()
'post_author' => get_current_user_id(),
);
// update name

View File

@ -176,10 +176,10 @@ class WC_AJAX {
// Fragments and mini cart are returned
$data = array(
'fragments' => apply_filters( 'woocommerce_add_to_cart_fragments', array(
'div.widget_shopping_cart_content' => '<div class="widget_shopping_cart_content">' . $mini_cart . '</div>'
'div.widget_shopping_cart_content' => '<div class="widget_shopping_cart_content">' . $mini_cart . '</div>',
)
),
'cart_hash' => apply_filters( 'woocommerce_add_to_cart_hash', WC()->cart->get_cart_for_session() ? md5( json_encode( WC()->cart->get_cart_for_session() ) ) : '', WC()->cart->get_cart_for_session() )
'cart_hash' => apply_filters( 'woocommerce_add_to_cart_hash', WC()->cart->get_cart_for_session() ? md5( json_encode( WC()->cart->get_cart_for_session() ) ) : '', WC()->cart->get_cart_for_session() ),
);
wp_send_json( $data );
@ -287,8 +287,8 @@ class WC_AJAX {
if ( WC()->cart->is_empty() ) {
$data = array(
'fragments' => apply_filters( 'woocommerce_update_order_review_fragments', array(
'form.woocommerce-checkout' => '<div class="woocommerce-error">' . __( 'Sorry, your session has expired.', 'woocommerce' ) . ' <a href="' . esc_url( wc_get_page_permalink( 'shop' ) ) . '" class="wc-backward">' . __( 'Return to shop', 'woocommerce' ) . '</a></div>'
) )
'form.woocommerce-checkout' => '<div class="woocommerce-error">' . __( 'Sorry, your session has expired.', 'woocommerce' ) . ' <a href="' . esc_url( wc_get_page_permalink( 'shop' ) ) . '" class="wc-backward">' . __( 'Return to shop', 'woocommerce' ) . '</a></div>',
) ),
);
wp_send_json( $data );
@ -414,8 +414,8 @@ class WC_AJAX {
'reload' => isset( WC()->session->reload_checkout ) ? 'true' : 'false',
'fragments' => apply_filters( 'woocommerce_update_order_review_fragments', array(
'.woocommerce-checkout-review-order-table' => $woocommerce_order_review,
'.woocommerce-checkout-payment' => $woocommerce_checkout_payment
) )
'.woocommerce-checkout-payment' => $woocommerce_checkout_payment,
) ),
);
unset( WC()->session->refresh_totals, WC()->session->reload_checkout );
@ -452,7 +452,7 @@ class WC_AJAX {
// If there was an error adding to the cart, redirect to the product page to show any errors
$data = array(
'error' => true,
'product_url' => apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id )
'product_url' => apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id ),
);
wp_send_json( $data );
@ -559,7 +559,7 @@ class WC_AJAX {
'value' => '',
'is_visible' => apply_filters( 'woocommerce_attribute_default_visibility', 1 ),
'is_variation' => apply_filters( 'woocommerce_attribute_default_is_variation', 0 ),
'is_taxonomy' => $taxonomy ? 1 : 0
'is_taxonomy' => $taxonomy ? 1 : 0,
);
if ( $taxonomy ) {
@ -596,14 +596,14 @@ class WC_AJAX {
if ( is_wp_error( $result ) ) {
wp_send_json( array(
'error' => $result->get_error_message()
'error' => $result->get_error_message(),
) );
} else {
$term = get_term_by( 'id', $result['term_id'], $taxonomy );
wp_send_json( array(
'term_id' => $term->term_id,
'name' => $term->name,
'slug' => $term->slug
'slug' => $term->slug,
) );
}
}
@ -725,7 +725,7 @@ class WC_AJAX {
'position' => $attribute_position[ $i ],
'is_visible' => $is_visible,
'is_variation' => $is_variation,
'is_taxonomy' => $is_taxonomy
'is_taxonomy' => $is_taxonomy,
);
}
@ -742,7 +742,7 @@ class WC_AJAX {
'position' => $attribute_position[ $i ],
'is_visible' => $is_visible,
'is_variation' => $is_variation,
'is_taxonomy' => $is_taxonomy
'is_taxonomy' => $is_taxonomy,
);
}
@ -780,7 +780,7 @@ class WC_AJAX {
'post_author' => get_current_user_id(),
'post_parent' => $post_id,
'post_type' => 'product_variation',
'menu_order' => -1
'menu_order' => -1,
);
$variation_id = wp_insert_post( $variation );
@ -813,7 +813,7 @@ class WC_AJAX {
'_stock_status' => '',
'_backorders' => null,
'_tax_class' => null,
'_variation_description' => ''
'_variation_description' => '',
);
foreach ( $variation_fields as $field => $value ) {
@ -851,13 +851,13 @@ class WC_AJAX {
$backorder_options = array(
'no' => __( 'Do not allow', 'woocommerce' ),
'notify' => __( 'Allow, but notify customer', 'woocommerce' ),
'yes' => __( 'Allow', 'woocommerce' )
'yes' => __( 'Allow', 'woocommerce' ),
);
// set stock status options
$stock_status_options = array(
'instock' => __( 'In stock', 'woocommerce' ),
'outofstock' => __( 'Out of stock', 'woocommerce' )
'outofstock' => __( 'Out of stock', 'woocommerce' ),
);
// Get attributes
@ -874,7 +874,7 @@ class WC_AJAX {
'height' => wc_format_localized_decimal( get_post_meta( $post_id, '_height', true ) ),
'tax_class' => get_post_meta( $post_id, '_tax_class', true ),
'backorder_options' => $backorder_options,
'stock_status_options' => $stock_status_options
'stock_status_options' => $stock_status_options,
);
if ( ! $parent_data['weight'] ) {
@ -968,7 +968,7 @@ class WC_AJAX {
'post_status' => 'publish',
'post_author' => get_current_user_id(),
'post_parent' => $post_id,
'post_type' => 'product_variation'
'post_type' => 'product_variation',
);
$variation_ids = array();
@ -1683,7 +1683,7 @@ class WC_AJAX {
'include' => $posts_in,
's' => $term,
'fields' => 'ids',
'exclude' => $exclude
'exclude' => $exclude,
);
$posts = get_posts( $args );
@ -1733,11 +1733,11 @@ class WC_AJAX {
'meta_query' => array(
array(
'key' => '_downloadable',
'value' => 'yes'
'value' => 'yes',
)
),
's' => $term,
'exclude' => $exclude
'exclude' => $exclude,
);
$posts = get_posts( $args );
@ -1789,7 +1789,7 @@ class WC_AJAX {
'fields' => 'all',
'orderby' => 'display_name',
'search' => '*' . $term . '*',
'search_columns' => array( 'ID', 'user_login', 'user_email', 'user_nicename' )
'search_columns' => array( 'ID', 'user_login', 'user_email', 'user_nicename' ),
) ) );
remove_action( 'pre_user_query', array( __CLASS__, 'json_search_customer_name' ) );
@ -1898,7 +1898,7 @@ class WC_AJAX {
$wpdb->update(
$wpdb->posts,
array(
'menu_order' => $menu_order
'menu_order' => $menu_order,
),
array( 'ID' => $post->ID ),
array( '%d' ),
@ -1917,7 +1917,7 @@ class WC_AJAX {
$wpdb->update(
$wpdb->posts,
array(
'menu_order' => $menu_order
'menu_order' => $menu_order,
),
array( 'ID' => $sibling->ID ),
array( '%d' ),
@ -1930,7 +1930,7 @@ class WC_AJAX {
$wpdb->update(
$wpdb->posts,
array(
'menu_order' => $menu_order
'menu_order' => $menu_order,
),
array( 'ID' => $post->ID ),
array( '%d' ),
@ -2143,7 +2143,7 @@ class WC_AJAX {
$data = array(
'user_id' => $user_id,
'description' => $description,
'permissions' => $permissions
'permissions' => $permissions,
);
$wpdb->update(
@ -2171,7 +2171,7 @@ class WC_AJAX {
'permissions' => $permissions,
'consumer_key' => wc_api_hash( $consumer_key ),
'consumer_secret' => $consumer_secret,
'truncated_key' => substr( $consumer_key, -7 )
'truncated_key' => substr( $consumer_key, -7 ),
);
$wpdb->insert(
@ -2251,13 +2251,13 @@ class WC_AJAX {
$backorder_options = array(
'no' => __( 'Do not allow', 'woocommerce' ),
'notify' => __( 'Allow, but notify customer', 'woocommerce' ),
'yes' => __( 'Allow', 'woocommerce' )
'yes' => __( 'Allow', 'woocommerce' ),
);
// set stock status options
$stock_status_options = array(
'instock' => __( 'In stock', 'woocommerce' ),
'outofstock' => __( 'Out of stock', 'woocommerce' )
'outofstock' => __( 'Out of stock', 'woocommerce' ),
);
$parent_data = array(
@ -2271,7 +2271,7 @@ class WC_AJAX {
'height' => wc_format_localized_decimal( get_post_meta( $product_id, '_height', true ) ),
'tax_class' => get_post_meta( $product_id, '_tax_class', true ),
'backorder_options' => $backorder_options,
'stock_status_options' => $stock_status_options
'stock_status_options' => $stock_status_options,
);
if ( ! $parent_data['weight'] ) {
@ -2297,7 +2297,7 @@ class WC_AJAX {
'posts_per_page' => $per_page,
'paged' => $page,
'orderby' => array( 'menu_order' => 'ASC', 'ID' => 'DESC' ),
'post_parent' => $product_id
'post_parent' => $product_id,
), $product_id );
$variations = get_posts( $args );
@ -2331,7 +2331,7 @@ class WC_AJAX {
'_stock_status' => '',
'_backorders' => null,
'_tax_class' => null,
'_variation_description' => ''
'_variation_description' => '',
);
foreach ( $variation_fields as $field => $value ) {
@ -2800,7 +2800,7 @@ class WC_AJAX {
'posts_per_page' => -1,
'post_type' => 'product_variation',
'fields' => 'ids',
'post_status' => array( 'publish', 'private' )
'post_status' => array( 'publish', 'private' ),
) );
}
@ -2925,7 +2925,7 @@ class WC_AJAX {
'zone_name' => 1,
'zone_order' => 1,
'zone_locations' => 1,
'zone_postcodes' => 1
'zone_postcodes' => 1,
) );
if ( isset( $zone_data['zone_id'] ) ) {
@ -2972,7 +2972,7 @@ class WC_AJAX {
}
wp_send_json_success( array(
'zones' => WC_Shipping_Zones::get_zones()
'zones' => WC_Shipping_Zones::get_zones(),
) );
}
@ -3003,7 +3003,7 @@ class WC_AJAX {
wp_send_json_success( array(
'instance_id' => $instance_id,
'zone_id' => $zone_id,
'methods' => $zone->get_shipping_methods()
'methods' => $zone->get_shipping_methods(),
) );
}
@ -3047,7 +3047,7 @@ class WC_AJAX {
$method_data = array_intersect_key( $data, array(
'method_order' => 1,
'enabled' => 1
'enabled' => 1,
) );
if ( isset( $method_data['method_order'] ) ) {
@ -3063,7 +3063,7 @@ class WC_AJAX {
}
wp_send_json_success( array(
'methods' => $zone->get_shipping_methods()
'methods' => $zone->get_shipping_methods(),
) );
}
@ -3162,7 +3162,7 @@ class WC_AJAX {
$wc_shipping = WC_Shipping::instance();
wp_send_json_success( array(
'shipping_classes' => $wc_shipping->get_shipping_classes()
'shipping_classes' => $wc_shipping->get_shipping_classes(),
) );
}
}

View File

@ -226,7 +226,7 @@ class WC_Auth {
'permissions' => $permissions,
'consumer_key' => wc_api_hash( $consumer_key ),
'consumer_secret' => $consumer_secret,
'truncated_key' => substr( $consumer_key, -7 )
'truncated_key' => substr( $consumer_key, -7 ),
),
array(
'%d',
@ -243,7 +243,7 @@ class WC_Auth {
'user_id' => $app_user_id,
'consumer_key' => $consumer_key,
'consumer_secret' => $consumer_secret,
'key_permissions' => $permissions
'key_permissions' => $permissions,
);
}
@ -264,7 +264,7 @@ class WC_Auth {
'timeout' => 60,
'headers' => array(
'Content-Type' => 'application/json;charset=' . get_bloginfo( 'charset' ),
)
),
);
$response = wp_safe_remote_post( esc_url_raw( $url ), $params );
@ -349,7 +349,7 @@ class WC_Auth {
'permissions' => $this->get_permissions_in_scope( wc_clean( $_REQUEST['scope'] ) ),
'granted_url' => wp_nonce_url( $this->build_url( $_REQUEST, 'access_granted' ), 'wc_auth_grant_access', 'wc_auth_nonce' ),
'logout_url' => wp_logout_url( $this->build_url( $_REQUEST, 'login' ) ),
'user' => wp_get_current_user()
'user' => wp_get_current_user(),
) );
exit;

Some files were not shown because too many files have changed in this diff Show More