Merge pull request #1 from woothemes/master

repo sync
This commit is contained in:
Kevin Hagerty 2015-09-07 17:23:28 -04:00
commit 4d32da5479
25 changed files with 181 additions and 103 deletions

File diff suppressed because one or more lines are too long

View File

@ -4160,6 +4160,78 @@ table.bar_chart {
text-align: center;
margin-top: 10px;
}
.post-type-product {
.wp-list-table {
.column-thumb {
display: none;
text-align: left;
padding-bottom: 0;
&:before {
display: none !important;
}
img {
max-width: 32px;
}
}
.is-expanded {
td {
&:not(.hidden) {
overflow: visible;
}
}
}
.toggle-row {
top: -28px;
}
}
}
.post-type-shop_order {
.wp-list-table {
.column-order_status {
display: none;
text-align: left;
padding-bottom: 0;
mark {
margin: 0;
}
&:before {
display: none !important;
}
}
.column-customer_message,
.column-order_notes {
text-align: inherit;
}
.column-order_notes {
.note-on {
font-size: 1.3em;
margin: 0;
}
}
.is-expanded {
td {
&:not(.hidden) {
overflow: visible;
}
}
}
.toggle-row {
top: -15px;
}
}
}
}
@media only screen and (max-width: 500px) {

File diff suppressed because one or more lines are too long

View File

@ -1789,6 +1789,7 @@ p.demo_store {
text-align: left;
margin: 0;
font-weight: normal;
@include clearfix;
input {
margin: 0 1em 0 0;

View File

@ -553,7 +553,7 @@ jQuery( function( $ ) {
if ( attachment.id ) {
attachment_ids = attachment_ids ? attachment_ids + ',' + attachment.id : attachment.id;
var attachment_image = attachment.sizes.thumbnail ? attachment.sizes.thumbnail.url : attachment.url;
var attachment_image = attachment.sizes && attachment.sizes.thumbnail ? attachment.sizes.thumbnail.url : attachment.url;
$product_images.append( '<li class="image" data-attachment_id="' + attachment.id + '"><img src="' + attachment_image + '" /><ul class="actions"><li><a href="#" class="delete" title="' + $el.data('delete') + '">' + $el.data('text') + '</a></li></ul></li>' );
}

File diff suppressed because one or more lines are too long

View File

@ -45,9 +45,10 @@ jQuery( function( $ ) {
// Support form elements
$( 'form' ).each( function() {
var $this = $( this );
var $this = $( this );
var method = $this.attr( 'method' );
if ( 'get' === $this.attr( 'method' ).toLowerCase() ) {
if ( method && 'get' === method.toLowerCase() ) {
$this.append( '<input type="hidden" name="v" value="' + wc_geolocation_params.hash + '" />' );
} else {
var href = $this.attr( 'action' );
@ -60,6 +61,9 @@ jQuery( function( $ ) {
}
}
});
// Append hashes on load
$append_hashes();
}
$( document.body ).on( 'added_to_cart', function() {

View File

@ -1 +1 @@
jQuery(function(a){var b=window.location.toString(),c=function(){wc_geolocation_params.hash&&a('a[href^="'+wc_geolocation_params.home_url+'"]:not(a[href*="v="]), a[href^="/"]:not(a[href*="v="])').each(function(){var b=a(this),c=b.attr("href");c.indexOf("?")>0?b.attr("href",c+"&v="+wc_geolocation_params.hash):b.attr("href",c+"?v="+wc_geolocation_params.hash)})},d=function(a){b=b.indexOf("?v=")>0||b.indexOf("&v=")>0?b.replace(/v=[^&]+/,"v="+a):b.indexOf("?")>0?b+"&v="+a:b+"?v="+a,window.location=b},e={url:wc_geolocation_params.wc_ajax_url.toString().replace("%%endpoint%%","get_customer_location"),type:"GET",success:function(a){a.success&&a.data.hash&&a.data.hash!==wc_geolocation_params.hash&&d(a.data.hash)}};"1"!==wc_geolocation_params.is_checkout&&"1"!==wc_geolocation_params.is_cart&&"1"!==wc_geolocation_params.is_account_page&&(a.ajax(e),a("form").each(function(){var b=a(this);if("get"===b.attr("method").toLowerCase())b.append('<input type="hidden" name="v" value="'+wc_geolocation_params.hash+'" />');else{var c=b.attr("action");c&&(c.indexOf("?")>0?b.attr("action",c+"&v="+wc_geolocation_params.hash):b.attr("action",c+"?v="+wc_geolocation_params.hash))}})),a(document.body).on("added_to_cart",function(){c()})});
jQuery(function(a){var b=window.location.toString(),c=function(){wc_geolocation_params.hash&&a('a[href^="'+wc_geolocation_params.home_url+'"]:not(a[href*="v="]), a[href^="/"]:not(a[href*="v="])').each(function(){var b=a(this),c=b.attr("href");c.indexOf("?")>0?b.attr("href",c+"&v="+wc_geolocation_params.hash):b.attr("href",c+"?v="+wc_geolocation_params.hash)})},d=function(a){b=b.indexOf("?v=")>0||b.indexOf("&v=")>0?b.replace(/v=[^&]+/,"v="+a):b.indexOf("?")>0?b+"&v="+a:b+"?v="+a,window.location=b},e={url:wc_geolocation_params.wc_ajax_url.toString().replace("%%endpoint%%","get_customer_location"),type:"GET",success:function(a){a.success&&a.data.hash&&a.data.hash!==wc_geolocation_params.hash&&d(a.data.hash)}};"1"!==wc_geolocation_params.is_checkout&&"1"!==wc_geolocation_params.is_cart&&"1"!==wc_geolocation_params.is_account_page&&(a.ajax(e),a("form").each(function(){var b=a(this),c=b.attr("method");if(c&&"get"===c.toLowerCase())b.append('<input type="hidden" name="v" value="'+wc_geolocation_params.hash+'" />');else{var d=b.attr("action");d&&(d.indexOf("?")>0?b.attr("action",d+"&v="+wc_geolocation_params.hash):b.attr("action",d+"?v="+wc_geolocation_params.hash))}}),c()),a(document.body).on("added_to_cart",function(){c()})});

View File

@ -73,51 +73,41 @@ abstract class WC_Shipping_Method extends WC_Settings_API {
* @param array $args (default: array())
*/
public function add_rate( $args = array() ) {
$defaults = array(
$args = wp_parse_args( $args, array(
'id' => '', // ID for the rate
'label' => '', // Label for the rate
'cost' => '0', // Amount or array of costs (per item shipping)
'taxes' => '', // Pass taxes, nothing to have it calculated for you, or 'false' to calc no tax
'calc_tax' => 'per_order' // Calc tax per_order or per_item. Per item needs an array of costs
);
$args = wp_parse_args( $args, $defaults );
extract( $args );
) );
// Id and label are required
if ( ! $id || ! $label ) {
if ( ! $args['id'] || ! $args['label'] ) {
return;
}
// Handle cost
$total_cost = is_array( $cost ) ? array_sum( $cost ) : $cost;
$total_cost = is_array( $args['cost'] ) ? array_sum( $args['cost'] ) : $args['cost'];
$taxes = $args['taxes'];
// Taxes - if not an array and not set to false, calc tax based on cost and passed calc_tax variable
// This saves shipping methods having to do complex tax calculations
if ( ! is_array( $taxes ) && $taxes !== false && $total_cost > 0 && $this->is_taxable() ) {
$taxes = array();
switch ( $calc_tax ) {
switch ( $args['calc_tax'] ) {
case "per_item" :
// If we have an array of costs we can look up each items tax class and add tax accordingly
if ( is_array( $cost ) ) {
if ( is_array( $args['cost'] ) ) {
$cart = WC()->cart->get_cart();
foreach ( $cost as $cost_key => $amount ) {
foreach ( $args['cost'] as $cost_key => $amount ) {
if ( ! isset( $cart[ $cost_key ] ) ) {
continue;
}
$_product = $cart[ $cost_key ]['data'];
$rates = WC_Tax::get_shipping_tax_rates( $_product->get_tax_class() );
$item_taxes = WC_Tax::calc_shipping_tax( $amount, $rates );
$item_taxes = WC_Tax::calc_shipping_tax( $amount, WC_Tax::get_shipping_tax_rates( $cart[ $cost_key ]['data']->get_tax_class() ) );
// Sum the item taxes
foreach ( array_keys( $taxes + $item_taxes ) as $key ) {
@ -126,10 +116,8 @@ abstract class WC_Shipping_Method extends WC_Settings_API {
}
// Add any cost for the order - order costs are in the key 'order'
if ( isset( $cost['order'] ) ) {
$rates = WC_Tax::get_shipping_tax_rates();
$item_taxes = WC_Tax::calc_shipping_tax( $cost['order'], $rates );
if ( isset( $args['cost']['order'] ) ) {
$item_taxes = WC_Tax::calc_shipping_tax( $args['cost']['order'], WC_Tax::get_shipping_tax_rates() );
// Sum the item taxes
foreach ( array_keys( $taxes + $item_taxes ) as $key ) {
@ -137,19 +125,14 @@ abstract class WC_Shipping_Method extends WC_Settings_API {
}
}
}
break;
default :
$rates = WC_Tax::get_shipping_tax_rates();
$taxes = WC_Tax::calc_shipping_tax( $total_cost, $rates );
$taxes = WC_Tax::calc_shipping_tax( $total_cost, WC_Tax::get_shipping_tax_rates() );
break;
}
}
$this->rates[] = new WC_Shipping_Rate( $id, $label, $total_cost, $taxes, $this->id );
$this->rates[] = new WC_Shipping_Rate( $args['id'], $args['label'], $total_cost, $taxes, $this->id );
}
/**

View File

@ -721,8 +721,6 @@ class WC_Admin_Post_Types {
$customer_tip[] = __( 'Tel:', 'woocommerce' ) . ' ' . $the_order->billing_phone;
}
echo '<div class="tips" data-tip="' . wc_sanitize_tooltip( implode( "<br/>", $customer_tip ) ) . '">';
if ( $the_order->user_id ) {
$user_info = get_userdata( $the_order->user_id );
}
@ -753,7 +751,7 @@ class WC_Admin_Post_Types {
echo '<small class="meta email"><a href="' . esc_url( 'mailto:' . $the_order->billing_email ) . '">' . esc_html( $the_order->billing_email ) . '</a></small>';
}
echo '</div>';
echo '<button type="button" class="toggle-row"><span class="screen-reader-text">' . __( 'Show more details', 'woocommerce' ) . '</span></button>';
break;
case 'order_actions' :

View File

@ -612,7 +612,7 @@ class WC_Meta_Box_Product_Data {
}
}
$variations_count = absint( $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(ID) FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'product_variation'", $post->ID ) ) );
$variations_count = absint( $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(ID) FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'product_variation' AND post_status IN ('publish', 'private')", $post->ID ) ) );
$variations_per_page = absint( apply_filters( 'woocommerce_admin_meta_boxes_variations_per_page', 10 ) );
$variations_total_pages = ceil( $variations_count / $variations_per_page );
?>

View File

@ -183,13 +183,7 @@ if ( wc_tax_enabled() ) {
<tr>
<td class="label"><?php _e( 'Order Total', 'woocommerce' ); ?>:</td>
<td class="total">
<div class="view"><?php
if ( $order->get_total_refunded() > 0 ) {
echo '<del>' . strip_tags( $order->get_formatted_order_total() ) . '</del> <ins>' . wc_price( $order->get_total() - $order->get_total_refunded(), array( 'currency' => $order->get_order_currency() ) ) . '</ins>';
} else {
echo esc_html( strip_tags( $order->get_formatted_order_total() ) );
}
?></div>
<div class="view"><?php echo $order->get_formatted_order_total(); ?></div>
<div class="edit" style="display: none;">
<input type="text" class="wc_input_price" id="_order_total" name="_order_total" placeholder="<?php echo wc_format_localized_price( 0 ); ?>" value="<?php echo ( isset( $data['_order_total'][0] ) ) ? esc_attr( wc_format_localized_price( $data['_order_total'][0] ) ) : ''; ?>" />
<div class="clear"></div>

View File

@ -61,40 +61,50 @@ function wc_create_page( $slug, $option = '', $page_title = '', $page_content =
global $wpdb;
$option_value = get_option( $option );
$page_found_trash = false;
if ( $option_value > 0 && ( $page_object = get_post( $option_value ) ) ) {
if ( 'trash' != $page_object->post_status ) {
return -1;
} else {
$page_found_trash = true;
if ( $option_value > 0 ) {
$page_object = get_post( $option_value );
if ( 'page' === $page_object->post_type && ! in_array( $page_object->post_status, array( 'pending', 'trash', 'future', 'auto-draft' ) ) ) {
// Valid page is already in place
return $page_object->ID;
}
}
if ( strlen( $page_content ) > 0 ) {
// Search for an existing page with the specified page content (typically a shortcode)
$page_found = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_type='page' AND post_content LIKE %s LIMIT 1;", "%{$page_content}%" ) );
$valid_page_found = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_type='page' AND post_status NOT IN ( 'pending', 'trash', 'future', 'auto-draft' ) AND post_content LIKE %s LIMIT 1;", "%{$page_content}%" ) );
} else {
// Search for an existing page with the specified page slug
$page_found = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_type='page' AND post_name = %s LIMIT 1;", $slug ) );
$valid_page_found = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_type='page' AND post_status NOT IN ( 'pending', 'trash', 'future', 'auto-draft' ) AND post_name = %s LIMIT 1;", $slug ) );
}
$page_found = apply_filters( 'woocommerce_create_page_id', $page_found, $slug, $page_content );
$valid_page_found = apply_filters( 'woocommerce_create_page_id', $valid_page_found, $slug, $page_content );
if ( $page_found && ! $page_found_trash ) {
if ( ! $option_value ) {
update_option( $option, $page_found );
if ( $valid_page_found ) {
if ( $option ) {
update_option( $option, $valid_page_found );
}
return $page_found;
}
elseif ( ! $page_found && $page_found_trash ) {
// Page was found in trash but it did not have the correct shortcode (so just recreate it)
$page_found_trash = false;
return $valid_page_found;
}
if ( ! $page_found_trash ) {
// Search for a matching valid trashed page
if ( strlen( $page_content ) > 0 ) {
// Search for an existing page with the specified page content (typically a shortcode)
$trashed_page_found = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_type='page' AND post_status = 'trash' AND post_content LIKE %s LIMIT 1;", "%{$page_content}%" ) );
} else {
// Search for an existing page with the specified page slug
$trashed_page_found = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_type='page' AND post_status = 'trash' AND post_name = %s LIMIT 1;", $slug ) );
}
if ( $trashed_page_found ) {
$page_id = $trashed_page_found;
$page_data = array(
'ID' => $page_id,
'post_status' => 'publish',
);
wp_update_post( $page_data );
} else {
$page_data = array(
'post_status' => 'publish',
'post_type' => 'page',
@ -105,13 +115,7 @@ function wc_create_page( $slug, $option = '', $page_title = '', $page_content =
'post_parent' => $post_parent,
'comment_status' => 'closed'
);
$page_id = wp_insert_post( $page_data );
} else {
$page_data = array(
'ID' => $page_found,
'post_status' => 'publish',
);
$page_id = wp_update_post( $page_data );
$page_id = wp_insert_post( $page_data );
}
if ( $option ) {

View File

@ -232,7 +232,7 @@ class WC_API_Orders extends WC_API_Resource {
foreach ( $meta->get_formatted( $hideprefix ) as $meta_key => $formatted_meta ) {
$item_meta[] = array(
'key' => $meta_key,
'key' => $formatted_meta['key'],
'label' => $formatted_meta['label'],
'value' => $formatted_meta['value'],
);

View File

@ -232,7 +232,7 @@ class WC_API_Orders extends WC_API_Resource {
foreach ( $meta->get_formatted( $hideprefix ) as $meta_key => $formatted_meta ) {
$item_meta[] = array(
'key' => $meta_key,
'key' => $formatted_meta['key'],
'label' => $formatted_meta['label'],
'value' => $formatted_meta['value'],
);

View File

@ -2369,7 +2369,7 @@ class WC_AJAX {
}
$key_id = absint( $_POST['key_id'] );
$description = sanitize_text_field( $_POST['description'] );
$description = sanitize_text_field( wp_unslash( $_POST['description'] ) );
$permissions = ( in_array( $_POST['permissions'], array( 'read', 'write', 'read_write' ) ) ) ? sanitize_text_field( $_POST['permissions'] ) : 'read';
$user_id = absint( $_POST['user'] );

View File

@ -53,6 +53,10 @@ class WC_Cache_Helper {
$redirect_url = trailingslashit( home_url( $wp->request ) );
if ( ! empty( $_SERVER['QUERY_STRING'] ) ) {
$redirect_url = add_query_arg( $_SERVER['QUERY_STRING'], '', $redirect_url );
}
if ( ! get_option( 'permalink_structure' ) ) {
$redirect_url = add_query_arg( $wp->query_string, '', $redirect_url );
}

View File

@ -169,7 +169,7 @@ class WC_Cart {
* Will set cart cookies if needed, once, during WP hook
*/
public function maybe_set_cart_cookies() {
if ( ! headers_sent() ) {
if ( ! headers_sent() && did_action( 'wp_loaded' ) ) {
if ( ! $this->is_empty() ) {
$this->set_cart_cookies( true );
} elseif ( isset( $_COOKIE['woocommerce_items_in_cart'] ) ) {

View File

@ -168,19 +168,30 @@ class WC_Form_Handler {
$user->first_name = $account_first_name;
$user->last_name = $account_last_name;
$user->user_email = $account_email;
// Prevent emails being displayed, or leave alone.
$user->display_name = is_email( $current_user->display_name ) ? $user->first_name : $current_user->display_name;
if ( empty( $account_first_name ) || empty( $account_last_name ) ) {
wc_add_notice( __( 'Please enter your name.', 'woocommerce' ), 'error' );
// Handle required fields
$required_fields = apply_filters( 'woocommerce_save_account_details_required_fields', array(
'account_first_name' => __( 'First Name', 'woocommerce' ),
'account_last_name' => __( 'Last Name', 'woocommerce' ),
'account_email' => __( 'Email address', 'woocommerce' ),
) );
foreach ( $required_fields as $field_key => $field_name ) {
if ( empty( $_POST[ $field_key ] ) ) {
wc_add_notice( '<strong>' . esc_html( $field_name ) . '</strong> ' . __( 'is a required field.', 'woocommerce' ), 'error' );
}
}
if ( empty( $account_email ) || ! is_email( $account_email ) ) {
wc_add_notice( __( 'Please provide a valid email address.', 'woocommerce' ), 'error' );
} elseif ( email_exists( $account_email ) && $account_email !== $current_user->user_email ) {
wc_add_notice( __( 'This email address is already registered.', 'woocommerce' ), 'error' );
if ( $account_email ) {
if ( ! is_email( $account_email ) ) {
wc_add_notice( __( 'Please provide a valid email address.', 'woocommerce' ), 'error' );
} elseif ( email_exists( $account_email ) && $account_email !== $current_user->user_email ) {
wc_add_notice( __( 'This email address is already registered.', 'woocommerce' ), 'error' );
}
$user->user_email = $account_email;
}
if ( ! empty( $pass1 ) && ! wp_check_password( $pass_cur, $current_user->user_pass, $current_user->ID ) ) {
@ -190,19 +201,15 @@ class WC_Form_Handler {
if ( ! empty( $pass_cur ) && empty( $pass1 ) && empty( $pass2 ) ) {
wc_add_notice( __( 'Please fill out all password fields.', 'woocommerce' ), 'error' );
$save_pass = false;
} elseif ( ! empty( $pass1 ) && empty( $pass_cur ) ) {
wc_add_notice( __( 'Please enter your current password.', 'woocommerce' ), 'error' );
$save_pass = false;
} elseif ( ! empty( $pass1 ) && empty( $pass2 ) ) {
wc_add_notice( __( 'Please re-enter your password.', 'woocommerce' ), 'error' );
$save_pass = false;
} elseif ( ( ! empty( $pass1 ) || ! empty( $pass2 ) ) && $pass1 !== $pass2 ) {
wc_add_notice( __( 'New passwords do not match.', 'woocommerce' ), 'error' );
$save_pass = false;
}
@ -266,9 +273,7 @@ class WC_Form_Handler {
$order_id = absint( $wp->query_vars['order-pay'] );
$order = wc_get_order( $order_id );
$valid_order_statuses = apply_filters( 'woocommerce_valid_order_statuses_for_payment', array( 'pending', 'failed' ), $order );
if ( $order->id == $order_id && $order->order_key == $order_key && $order->has_status( $valid_order_statuses ) ) {
if ( $order->id == $order_id && $order->order_key == $order_key && $order->needs_payment() ) {
// Set customer location to order location
if ( $order->billing_country ) {

View File

@ -212,7 +212,7 @@ class WC_Query {
}
// Fix for verbose page rules
if ( $GLOBALS['wp_rewrite']->use_verbose_page_rules && isset( $q->queried_object_id ) && $q->queried_object_id === wc_get_page_id('shop') ) {
if ( $GLOBALS['wp_rewrite']->use_verbose_page_rules && isset( $q->queried_object->ID ) && $q->queried_object->ID === wc_get_page_id('shop') ) {
$q->set( 'post_type', 'product' );
$q->set( 'page', '' );
$q->set( 'pagename', '' );

View File

@ -84,8 +84,7 @@ class WC_Shortcode_Checkout {
// Pay for existing order
$order_key = $_GET[ 'key' ];
$order = wc_get_order( $order_id );
$valid_order_statuses = apply_filters( 'woocommerce_valid_order_statuses_for_payment', array( 'pending', 'failed' ), $order );
if ( ! current_user_can( 'pay_for_order', $order_id ) ) {
echo '<div class="woocommerce-error">' . __( 'Invalid order. If you have an account please log in and try again.', 'woocommerce' ) . ' <a href="' . wc_get_page_permalink( 'myaccount' ) . '" class="wc-forward">' . __( 'My Account', 'woocommerce' ) . '</a>' . '</div>';
return;
@ -93,7 +92,7 @@ class WC_Shortcode_Checkout {
if ( $order->id == $order_id && $order->order_key == $order_key ) {
if ( $order->has_status( $valid_order_statuses ) ) {
if ( $order->needs_payment() ) {
// Set customer location to order location
if ( $order->billing_country )
@ -118,11 +117,10 @@ class WC_Shortcode_Checkout {
// Pay for order after checkout step
$order_key = isset( $_GET['key'] ) ? wc_clean( $_GET['key'] ) : '';
$order = wc_get_order( $order_id );
$valid_order_statuses = apply_filters( 'woocommerce_valid_order_statuses_for_payment', array( 'pending', 'failed' ), $order );
if ( $order->id == $order_id && $order->order_key == $order_key ) {
if ( $order->has_status( $valid_order_statuses ) ) {
if ( $order->needs_payment() ) {
?>
<ul class="order_details">

View File

@ -104,7 +104,7 @@ function wc_create_order( $args = array() ) {
update_post_meta( $order_id, '_order_key', 'wc_' . apply_filters( 'woocommerce_generate_order_key', uniqid( 'order_' ) ) );
update_post_meta( $order_id, '_order_currency', get_woocommerce_currency() );
update_post_meta( $order_id, '_prices_include_tax', get_option( 'woocommerce_prices_include_tax' ) );
update_post_meta( $order_id, '_customer_ip_address', isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'] );
update_post_meta( $order_id, '_customer_ip_address', WC_Geolocation::get_ip_address() );
update_post_meta( $order_id, '_customer_user_agent', isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : '' );
update_post_meta( $order_id, '_customer_user', 0 );
update_post_meta( $order_id, '_created_via', sanitize_text_field( $args['created_via'] ) );

View File

@ -1793,7 +1793,7 @@ if ( ! function_exists( 'woocommerce_form_field' ) ) {
$field_html .= $field;
if ( $args['description'] ) {
$field_html .= '<span class="description">' . esc_attr( $args['description'] ) . '</span>';
$field_html .= '<span class="description">' . esc_html( $args['description'] ) . '</span>';
}
$container_class = 'form-row ' . esc_attr( implode( ' ', $args['class'] ) );

View File

@ -165,7 +165,22 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
* Fix - Removed extra ob_start() in class-wc-shortcodes.php.
* Fix - Show counts in category dropdown.
* Fix - Escape add to cart messages to stop translations from breaking cart events.
* Fix - Display of product/order tables in the dashboard when viewed on handheld devices.
* Fix - API order item 'key' value.
* Fix - Check specifically for Post IDs in WC Query verbose rules fix.
* Fix - Only run maybe_set_cart_cookies if cart was loaded to prevent notices.
* Fix - Variation loading/refresh after attribute saving.
* Fix - Add monthly cron schedule.
* Tweak - Add filters to control "shipped via" text.
* Tweak - Allow line breaks in non-variation attributes.
* Tweak - Renamed wc_var_prices transient to allow them to flush on product save.
* Tweak - woocommerce_save_account_details_required_fields hook.
* Tweak - Only 'count' published variations.
* Tweak - Display of order total in admin with refunds.
* Tweak - Use Geolocation class for customer IP detection.
* Tweak - Use the needs_payment function (DRY).
* Tweak - Tweak wc_create_page to work with trashed pages.
* Tweak - Redirect 'not right now' to referer in onboarding wizard.
* Template - Removed 'Payment' heading in `templates/checkout/form-pay.php`.
* Template - Removed unnecessary clearing div in `templates/checkout/payment.php`.

View File

@ -62,7 +62,7 @@ if ( $customer_orders ) : ?>
<?php
$actions = array();
if ( in_array( $order->get_status(), apply_filters( 'woocommerce_valid_order_statuses_for_payment', array( 'pending', 'failed' ), $order ) ) ) {
if ( $order->needs_payment() ) {
$actions['pay'] = array(
'url' => $order->get_checkout_payment_url(),
'name' => __( 'Pay', 'woocommerce' )