Fixed some coding style issues

This commit is contained in:
claudiosmweb 2014-11-19 17:01:06 -02:00
parent 59c8f9440e
commit 9b16425142
4 changed files with 14 additions and 2 deletions

View File

@ -308,6 +308,7 @@ class WC_Admin_Post_Types {
if ( ! $terms = get_the_terms( $post->ID, $column ) ) {
echo '<span class="na">&ndash;</span>';
} else {
$termlist = array();
foreach ( $terms as $term ) {
$termlist[] = '<a href="' . admin_url( 'edit.php?' . $column . '=' . $term->slug . '&post_type=product' ) . ' ">' . $term->name . '</a>';
}

View File

@ -125,6 +125,8 @@ class WC_Gateway_Paypal_Request {
* @return array
*/
protected function get_shipping_args( $order ) {
$shipping_args = array();
if ( 'yes' == $this->gateway->get_option( 'send_shipping' ) ) {
$shipping_args['address_override'] = $this->gateway->get_option( 'address_override' ) === 'yes' ? 1 : 0;
$shipping_args['no_shipping'] = 0;
@ -142,6 +144,7 @@ class WC_Gateway_Paypal_Request {
} else {
$shipping_args['no_shipping'] = 1;
}
return $shipping_args;
}

View File

@ -451,9 +451,11 @@ if ( ! function_exists( 'wc_rgb_from_hex' ) ) {
// Convert shorthand colors to full format, e.g. "FFF" -> "FFFFFF"
$color = preg_replace( '~^(.)(.)(.)$~', '$1$1$2$2$3$3', $color );
$rgb = array();
$rgb['R'] = hexdec( $color{0}.$color{1} );
$rgb['G'] = hexdec( $color{2}.$color{3} );
$rgb['B'] = hexdec( $color{4}.$color{5} );
return $rgb;
}
}

View File

@ -513,8 +513,11 @@ function wc_recount_after_stock_change( $product_id ) {
$product_terms = get_the_terms( $product_id, 'product_cat' );
if ( $product_terms ) {
foreach ( $product_terms as $term )
$product_cats = array();
foreach ( $product_terms as $term ) {
$product_cats[ $term->term_id ] = $term->parent;
}
_wc_term_recount( $product_cats, get_taxonomy( 'product_cat' ), false, false );
}
@ -522,8 +525,11 @@ function wc_recount_after_stock_change( $product_id ) {
$product_terms = get_the_terms( $product_id, 'product_tag' );
if ( $product_terms ) {
foreach ( $product_terms as $term )
$product_tags = array();
foreach ( $product_terms as $term ) {
$product_tags[ $term->term_id ] = $term->parent;
}
_wc_term_recount( $product_tags, get_taxonomy( 'product_tag' ), false, false );
}