End function requires variable to prevent strict standards errors

Just a temporary variable that is only used to pass an actual variable
to the PHP end function (as that takes a reference as argument). This
prevents strict standard errors.
This commit is contained in:
Coen Jacobs 2015-12-07 08:10:19 +01:00
parent 792e3605fe
commit bae582e3ff
1 changed files with 2 additions and 1 deletions

View File

@ -958,10 +958,11 @@ class WC_Countries {
$address_fields = array();
foreach ( $fields as $key => $value ) {
$keys = array_keys( $fields );
$address_fields[ $type . $key ] = $value;
// Add email and phone after company or last
if ( $type == 'billing_' && ( 'company' === $key || ( ! array_key_exists( 'company', $fields ) && $key === end( array_keys( $fields ) ) ) ) ) {
if ( $type == 'billing_' && ( 'company' === $key || ( ! array_key_exists( 'company', $fields ) && $key === end( $keys ) ) ) ) {
$address_fields['billing_email'] = array(
'label' => __( 'Email Address', 'woocommerce' ),
'required' => true,