Skip to content

Commit

Permalink
template coding standard fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
splashingpixels committed Apr 8, 2014
1 parent 128eeb1 commit 1e998f7
Show file tree
Hide file tree
Showing 13 changed files with 43 additions and 41 deletions.
3 changes: 2 additions & 1 deletion templates/checkout/form-coupon.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@

global $woocommerce;

if ( ! WC()->cart->coupons_enabled() )
if ( ! WC()->cart->coupons_enabled() ) {
return;
}

$info_message = apply_filters( 'woocommerce_checkout_coupon_message', __( 'Have a coupon?', 'woocommerce' ) );
$info_message .= ' <a href="#" class="showcoupon">' . __( 'Click here to enter your code', 'woocommerce' ) . '</a>';
Expand Down
2 changes: 1 addition & 1 deletion templates/checkout/form-login.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly

if ( is_user_logged_in() || 'no' == get_option( 'woocommerce_enable_checkout_login_reminder' ) ) return;
if ( is_user_logged_in() || 'no' === get_option( 'woocommerce_enable_checkout_login_reminder' ) ) return;

$info_message = apply_filters( 'woocommerce_checkout_login_message', __( 'Returning customer?', 'woocommerce' ) );
$info_message .= ' <a href="#" class="showlogin">' . __( 'Click here to login', 'woocommerce' ) . '</a>';
Expand Down
2 changes: 1 addition & 1 deletion templates/checkout/form-pay.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
</tfoot>
<tbody>
<?php
if ( sizeof( $order->get_items() )>0 ) :
if ( sizeof( $order->get_items() ) > 0 ) :
foreach ( $order->get_items() as $item ) :
echo '
<tr>
Expand Down
2 changes: 1 addition & 1 deletion templates/checkout/form-shipping.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<?php
if ( empty( $_POST ) ) {

$ship_to_different_address = get_option( 'woocommerce_ship_to_billing' ) == 'no' ? 1 : 0;
$ship_to_different_address = get_option( 'woocommerce_ship_to_billing' ) === 'no' ? 1 : 0;
$ship_to_different_address = apply_filters( 'woocommerce_ship_to_different_address_checked', $ship_to_different_address );

} else {
Expand Down
2 changes: 1 addition & 1 deletion templates/emails/customer-invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<?php do_action( 'woocommerce_email_header', $email_heading ); ?>

<?php if ( $order->status=='pending' ) : ?>
<?php if ( $order->status === 'pending' ) : ?>

<p><?php printf( __( 'An order has been created for you on %s. To pay for this order please use the following link: %s', 'woocommerce' ), get_bloginfo( 'name' ), '<a href="' . esc_url( $order->get_checkout_payment_url() ) . '">' . __( 'pay', 'woocommerce' ) . '</a>' ); ?></p>

Expand Down
2 changes: 1 addition & 1 deletion templates/emails/email-addresses.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

</td>

<?php if ( get_option( 'woocommerce_ship_to_billing_address_only' ) == 'no' && ( $shipping = $order->get_formatted_shipping_address() ) ) : ?>
<?php if ( get_option( 'woocommerce_ship_to_billing_address_only' ) === 'no' && ( $shipping = $order->get_formatted_shipping_address() ) ) : ?>

<td valign="top" width="50%">

Expand Down
18 changes: 9 additions & 9 deletions templates/loop/pagination.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
<nav class="woocommerce-pagination">
<?php
echo paginate_links( apply_filters( 'woocommerce_pagination_args', array(
'base' => str_replace( 999999999, '%#%', get_pagenum_link( 999999999 ) ),
'format' => '',
'current' => max( 1, get_query_var('paged') ),
'total' => $wp_query->max_num_pages,
'prev_text' => '&larr;',
'next_text' => '&rarr;',
'type' => 'list',
'end_size' => 3,
'mid_size' => 3
'base' => str_replace( 999999999, '%#%', get_pagenum_link( 999999999 ) ),
'format' => '',
'current' => max( 1, get_query_var( 'paged' ) ),
'total' => $wp_query->max_num_pages,
'prev_text' => '&larr;',
'next_text' => '&rarr;',
'type' => 'list',
'end_size' => 3,
'mid_size' => 3
) ) );
?>
</nav>
2 changes: 1 addition & 1 deletion templates/myaccount/form-edit-address.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

global $woocommerce, $current_user;

$page_title = ( $load_address == 'billing' ) ? __( 'Billing Address', 'woocommerce' ) : __( 'Shipping Address', 'woocommerce' );
$page_title = ( $load_address === 'billing' ) ? __( 'Billing Address', 'woocommerce' ) : __( 'Shipping Address', 'woocommerce' );

get_currentuserinfo();
?>
Expand Down
18 changes: 9 additions & 9 deletions templates/myaccount/my-address.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@
<address>
<?php
$address = apply_filters( 'woocommerce_my_account_my_address_formatted_address', array(
'first_name' => get_user_meta( $customer_id, $name . '_first_name', true ),
'last_name' => get_user_meta( $customer_id, $name . '_last_name', true ),
'company' => get_user_meta( $customer_id, $name . '_company', true ),
'address_1' => get_user_meta( $customer_id, $name . '_address_1', true ),
'address_2' => get_user_meta( $customer_id, $name . '_address_2', true ),
'city' => get_user_meta( $customer_id, $name . '_city', true ),
'state' => get_user_meta( $customer_id, $name . '_state', true ),
'postcode' => get_user_meta( $customer_id, $name . '_postcode', true ),
'country' => get_user_meta( $customer_id, $name . '_country', true )
'first_name' => get_user_meta( $customer_id, $name . '_first_name', true ),
'last_name' => get_user_meta( $customer_id, $name . '_last_name', true ),
'company' => get_user_meta( $customer_id, $name . '_company', true ),
'address_1' => get_user_meta( $customer_id, $name . '_address_1', true ),
'address_2' => get_user_meta( $customer_id, $name . '_address_2', true ),
'city' => get_user_meta( $customer_id, $name . '_city', true ),
'state' => get_user_meta( $customer_id, $name . '_state', true ),
'postcode' => get_user_meta( $customer_id, $name . '_postcode', true ),
'country' => get_user_meta( $customer_id, $name . '_country', true )
), $customer_id, $name );

$formatted_address = WC()->countries->get_formatted_address( $address );
Expand Down
8 changes: 4 additions & 4 deletions templates/single-product-reviews.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<div id="comments">
<h2><?php
if ( get_option( 'woocommerce_enable_review_rating' ) === 'yes' && ( $count = $product->get_rating_count() ) )
printf( _n('%s review for %s', '%s reviews for %s', $count, 'woocommerce'), $count, get_the_title() );
printf( _n( '%s review for %s', '%s reviews for %s', $count, 'woocommerce' ), $count, get_the_title() );
else
_e( 'Reviews', 'woocommerce' );
?></h2>
Expand All @@ -32,9 +32,9 @@
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) :
echo '<nav class="woocommerce-pagination">';
paginate_comments_links( apply_filters( 'woocommerce_comment_pagination_args', array(
'prev_text' => '&larr;',
'next_text' => '&rarr;',
'type' => 'list',
'prev_text' => '&larr;',
'next_text' => '&rarr;',
'type' => 'list',
) ) );
echo '</nav>';
endif; ?>
Expand Down
2 changes: 1 addition & 1 deletion templates/single-product/add-to-cart/variable.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
}
?>
</select> <?php
if ( sizeof($attributes) == $loop )
if ( sizeof( $attributes ) == $loop )
echo '<a class="reset_variations" href="#reset">' . __( 'Clear selection', 'woocommerce' ) . '</a>';
?></td>
</tr>
Expand Down
9 changes: 5 additions & 4 deletions templates/single-product/product-image.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@
<?php
if ( has_post_thumbnail() ) {

$image_title = esc_attr( get_the_title( get_post_thumbnail_id() ) );
$image_link = wp_get_attachment_url( get_post_thumbnail_id() );
$image = get_the_post_thumbnail( $post->ID, apply_filters( 'single_product_large_thumbnail_size', 'shop_single' ), array(
$image_title = esc_attr( get_the_title( get_post_thumbnail_id() ) );
$image_link = wp_get_attachment_url( get_post_thumbnail_id() );
$image = get_the_post_thumbnail( $post->ID, apply_filters( 'single_product_large_thumbnail_size', 'shop_single' ), array(
'title' => $image_title
) );
$attachment_count = count( $product->get_gallery_attachment_ids() );

$attachment_count = count( $product->get_gallery_attachment_ids() );

if ( $attachment_count > 0 ) {
$gallery = '[product-gallery]';
Expand Down
14 changes: 7 additions & 7 deletions templates/single-product/related.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
if ( sizeof( $related ) == 0 ) return;

$args = apply_filters( 'woocommerce_related_products_args', array(
'post_type' => 'product',
'ignore_sticky_posts' => 1,
'no_found_rows' => 1,
'posts_per_page' => $posts_per_page,
'orderby' => $orderby,
'post__in' => $related,
'post__not_in' => array( $product->id )
'post_type' => 'product',
'ignore_sticky_posts' => 1,
'no_found_rows' => 1,
'posts_per_page' => $posts_per_page,
'orderby' => $orderby,
'post__in' => $related,
'post__not_in' => array( $product->id )
) );

$products = new WP_Query( $args );
Expand Down

0 comments on commit 1e998f7

Please sign in to comment.