Skip to content

Commit

Permalink
Fixed mixed tabs and spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiosanches committed Jul 11, 2016
1 parent ec1c302 commit 7d9d091
Show file tree
Hide file tree
Showing 60 changed files with 3,749 additions and 3,744 deletions.
162 changes: 81 additions & 81 deletions includes/admin/meta-boxes/views/html-order-item-meta.php
Original file line number Diff line number Diff line change
@@ -1,94 +1,94 @@
<div class="view">
<?php
global $wpdb;
<?php
global $wpdb;

if ( $metadata = $order->has_meta( $item_id ) ) {
echo '<table cellspacing="0" class="display_meta">';
foreach ( $metadata as $meta ) {
if ( $metadata = $order->has_meta( $item_id ) ) {
echo '<table cellspacing="0" class="display_meta">';
foreach ( $metadata as $meta ) {

// Skip hidden core fields
if ( in_array( $meta['meta_key'], apply_filters( 'woocommerce_hidden_order_itemmeta', array(
'_qty',
'_tax_class',
'_product_id',
'_variation_id',
'_line_subtotal',
'_line_subtotal_tax',
'_line_total',
'_line_tax',
'method_id',
'cost'
) ) ) ) {
continue;
}
// Skip hidden core fields
if ( in_array( $meta['meta_key'], apply_filters( 'woocommerce_hidden_order_itemmeta', array(
'_qty',
'_tax_class',
'_product_id',
'_variation_id',
'_line_subtotal',
'_line_subtotal_tax',
'_line_total',
'_line_tax',
'method_id',
'cost'
) ) ) ) {
continue;
}

// Skip serialised meta
if ( is_serialized( $meta['meta_value'] ) ) {
continue;
}
// Skip serialised meta
if ( is_serialized( $meta['meta_value'] ) ) {
continue;
}

// Get attribute data
if ( taxonomy_exists( wc_sanitize_taxonomy_name( $meta['meta_key'] ) ) ) {
$term = get_term_by( 'slug', $meta['meta_value'], wc_sanitize_taxonomy_name( $meta['meta_key'] ) );
$meta['meta_key'] = wc_attribute_label( wc_sanitize_taxonomy_name( $meta['meta_key'] ) );
$meta['meta_value'] = isset( $term->name ) ? $term->name : $meta['meta_value'];
} else {
$meta['meta_key'] = wc_attribute_label( $meta['meta_key'], $_product );
}
// Get attribute data
if ( taxonomy_exists( wc_sanitize_taxonomy_name( $meta['meta_key'] ) ) ) {
$term = get_term_by( 'slug', $meta['meta_value'], wc_sanitize_taxonomy_name( $meta['meta_key'] ) );
$meta['meta_key'] = wc_attribute_label( wc_sanitize_taxonomy_name( $meta['meta_key'] ) );
$meta['meta_value'] = isset( $term->name ) ? $term->name : $meta['meta_value'];
} else {
$meta['meta_key'] = wc_attribute_label( $meta['meta_key'], $_product );
}

echo '<tr><th>' . wp_kses_post( rawurldecode( $meta['meta_key'] ) ) . ':</th><td>' . wp_kses_post( wpautop( make_clickable( rawurldecode( $meta['meta_value'] ) ) ) ) . '</td></tr>';
}
echo '</table>';
}
?>
echo '<tr><th>' . wp_kses_post( rawurldecode( $meta['meta_key'] ) ) . ':</th><td>' . wp_kses_post( wpautop( make_clickable( rawurldecode( $meta['meta_value'] ) ) ) ) . '</td></tr>';
}
echo '</table>';
}
?>
</div>
<div class="edit" style="display: none;">
<table class="meta" cellspacing="0">
<tbody class="meta_items">
<?php
if ( $metadata = $order->has_meta( $item_id )) {
foreach ( $metadata as $meta ) {
<table class="meta" cellspacing="0">
<tbody class="meta_items">
<?php
if ( $metadata = $order->has_meta( $item_id )) {
foreach ( $metadata as $meta ) {

// Skip hidden core fields
if ( in_array( $meta['meta_key'], apply_filters( 'woocommerce_hidden_order_itemmeta', array(
'_qty',
'_tax_class',
'_product_id',
'_variation_id',
'_line_subtotal',
'_line_subtotal_tax',
'_line_total',
'_line_tax',
'method_id',
'cost'
) ) ) ) {
continue;
}
// Skip hidden core fields
if ( in_array( $meta['meta_key'], apply_filters( 'woocommerce_hidden_order_itemmeta', array(
'_qty',
'_tax_class',
'_product_id',
'_variation_id',
'_line_subtotal',
'_line_subtotal_tax',
'_line_total',
'_line_tax',
'method_id',
'cost'
) ) ) ) {
continue;
}

// Skip serialised meta
if ( is_serialized( $meta['meta_value'] ) ) {
continue;
}
// Skip serialised meta
if ( is_serialized( $meta['meta_value'] ) ) {
continue;
}

$meta['meta_key'] = rawurldecode( $meta['meta_key'] );
$meta['meta_value'] = esc_textarea( rawurldecode( $meta['meta_value'] ) ); // using a <textarea />
$meta['meta_id'] = absint( $meta['meta_id'] );
$meta['meta_key'] = rawurldecode( $meta['meta_key'] );
$meta['meta_value'] = esc_textarea( rawurldecode( $meta['meta_value'] ) ); // using a <textarea />
$meta['meta_id'] = absint( $meta['meta_id'] );

echo '<tr data-meta_id="' . esc_attr( $meta['meta_id'] ) . '">
<td>
<input type="text" name="meta_key[' . $meta['meta_id'] . ']" value="' . esc_attr( $meta['meta_key'] ) . '" />
<textarea name="meta_value[' . $meta['meta_id'] . ']">' . $meta['meta_value'] . '</textarea>
</td>
<td width="1%"><button class="remove_order_item_meta button">&times;</button></td>
</tr>';
}
}
?>
</tbody>
<tfoot>
<tr>
<td colspan="4"><button class="add_order_item_meta button"><?php _e( 'Add&nbsp;meta', 'woocommerce' ); ?></button></td>
</tr>
</tfoot>
</table>
echo '<tr data-meta_id="' . esc_attr( $meta['meta_id'] ) . '">
<td>
<input type="text" name="meta_key[' . $meta['meta_id'] . ']" value="' . esc_attr( $meta['meta_key'] ) . '" />
<textarea name="meta_value[' . $meta['meta_id'] . ']">' . $meta['meta_value'] . '</textarea>
</td>
<td width="1%"><button class="remove_order_item_meta button">&times;</button></td>
</tr>';
}
}
?>
</tbody>
<tfoot>
<tr>
<td colspan="4"><button class="add_order_item_meta button"><?php _e( 'Add&nbsp;meta', 'woocommerce' ); ?></button></td>
</tr>
</tfoot>
</table>
</div>
2 changes: 1 addition & 1 deletion includes/admin/views/html-notice-custom.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@

?>
<div id="message" class="updated woocommerce-message">
<a class="woocommerce-message-close notice-dismiss" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'wc-hide-notice', $notice ), 'woocommerce_hide_notices_nonce', '_wc_notice_nonce' ) ); ?>"><?php _e( 'Dismiss', 'woocommerce' ); ?></a>
<a class="woocommerce-message-close notice-dismiss" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'wc-hide-notice', $notice ), 'woocommerce_hide_notices_nonce', '_wc_notice_nonce' ) ); ?>"><?php _e( 'Dismiss', 'woocommerce' ); ?></a>
<?php echo wp_kses_post( wpautop( $notice_html ) ); ?>
</div>
2 changes: 1 addition & 1 deletion includes/admin/views/html-notice-simplify-commerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
}
?>
<div id="message" class="updated woocommerce-message">
<a class="woocommerce-message-close notice-dismiss" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'wc-hide-notice', 'simplify_commerce' ), 'woocommerce_hide_notices_nonce', '_wc_notice_nonce' ) ); ?>"><?php _e( 'Dismiss', 'woocommerce' ); ?></a>
<a class="woocommerce-message-close notice-dismiss" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'wc-hide-notice', 'simplify_commerce' ), 'woocommerce_hide_notices_nonce', '_wc_notice_nonce' ) ); ?>"><?php _e( 'Dismiss', 'woocommerce' ); ?></a>

<p><?php _e( '<strong>The Simplify Commerce payment gateway is deprecated</strong> &#8211; Please install our new free Simplify Commerce plugin from WordPress.org. Simplify Commerce will be removed from WooCommerce core in a future update.', 'woocommerce' ); ?></p>

Expand Down
6 changes: 3 additions & 3 deletions includes/class-wc-download-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,9 @@ private static function download_headers( $file_path, $filename ) {
header( "Content-Disposition: attachment; filename=\"" . $filename . "\";" );
header( "Content-Transfer-Encoding: binary" );

if ( $size = @filesize( $file_path ) ) {
header( "Content-Length: " . $size );
}
if ( $size = @filesize( $file_path ) ) {
header( "Content-Length: " . $size );
}
}

/**
Expand Down
8 changes: 4 additions & 4 deletions includes/class-wc-integrations.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ class WC_Integrations {
*/
public $integrations = array();

/**
* Initialize integrations.
*/
public function __construct() {
/**
* Initialize integrations.
*/
public function __construct() {

do_action( 'woocommerce_integrations_init' );

Expand Down
24 changes: 12 additions & 12 deletions includes/class-wc-product-grouped.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,22 @@ public function add_to_cart_text() {
*/
public function get_children() {
if ( ! is_array( $this->children ) || empty( $this->children ) ) {
$transient_name = 'wc_product_children_' . $this->id;
$transient_name = 'wc_product_children_' . $this->id;
$this->children = array_filter( array_map( 'absint', (array) get_transient( $transient_name ) ) );

if ( empty( $this->children ) ) {
if ( empty( $this->children ) ) {

$args = apply_filters( 'woocommerce_grouped_children_args', array(
'post_parent' => $this->id,
'post_type' => 'product',
'orderby' => 'menu_order',
'order' => 'ASC',
'fields' => 'ids',
'post_status' => 'publish',
'numberposts' => -1,
) );
$args = apply_filters( 'woocommerce_grouped_children_args', array(
'post_parent' => $this->id,
'post_type' => 'product',
'orderby' => 'menu_order',
'order' => 'ASC',
'fields' => 'ids',
'post_status' => 'publish',
'numberposts' => -1,
) );

$this->children = get_posts( $args );
$this->children = get_posts( $args );

set_transient( $transient_name, $this->children, DAY_IN_SECONDS * 30 );
}
Expand Down
8 changes: 4 additions & 4 deletions includes/class-wc-shipping.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ public function __construct() {
}
}

/**
* Initialize shipping.
*/
public function init() {
/**
* Initialize shipping.
*/
public function init() {
do_action( 'woocommerce_shipping_init' );
}

Expand Down
4 changes: 2 additions & 2 deletions includes/class-wc-validation.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ public static function is_postcode( $postcode, $country ) {
case 'US' :
$valid = (bool) preg_match( '/^([0-9]{5})(-[0-9]{4})?$/i', $postcode );
break;
case 'CA' :
// CA Postal codes cannot contain D,F,I,O,Q,U and cannot start with W or Z. https://en.wikipedia.org/wiki/Postal_codes_in_Canada#Number_of_possible_postal_codes
case 'CA' :
// CA Postal codes cannot contain D,F,I,O,Q,U and cannot start with W or Z. https://en.wikipedia.org/wiki/Postal_codes_in_Canada#Number_of_possible_postal_codes
$valid = (bool) preg_match( '/^([ABCEGHJKLMNPRSTVXY]\d[ABCEGHJKLMNPRSTVWXYZ])([\ ])?(\d[ABCEGHJKLMNPRSTVWXYZ]\d)$/i', $postcode );
break;

Expand Down
2 changes: 1 addition & 1 deletion includes/emails/class-wc-email-failed-order.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function __construct() {
*/
public function trigger( $order_id ) {
if ( $order_id ) {
$this->object = wc_get_order( $order_id );
$this->object = wc_get_order( $order_id );
$this->find['order-date'] = '{order_date}';
$this->find['order-number'] = '{order_number}';
$this->replace['order-date'] = date_i18n( wc_date_format(), strtotime( $this->object->order_date ) );
Expand Down
64 changes: 32 additions & 32 deletions includes/gateways/cheque/class-wc-gateway-cheque.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
*/
class WC_Gateway_Cheque extends WC_Payment_Gateway {

/**
* Constructor for the gateway.
*/
/**
* Constructor for the gateway.
*/
public function __construct() {
$this->id = 'cheque';
$this->icon = apply_filters( 'woocommerce_cheque_icon', '' );
Expand All @@ -38,18 +38,18 @@ public function __construct() {

// Actions
add_action( 'woocommerce_update_options_payment_gateways_' . $this->id, array( $this, 'process_admin_options' ) );
add_action( 'woocommerce_thankyou_cheque', array( $this, 'thankyou_page' ) );
add_action( 'woocommerce_thankyou_cheque', array( $this, 'thankyou_page' ) );

// Customer Emails
add_action( 'woocommerce_email_before_order_table', array( $this, 'email_instructions' ), 10, 3 );
}
// Customer Emails
add_action( 'woocommerce_email_before_order_table', array( $this, 'email_instructions' ), 10, 3 );
}

/**
* Initialise Gateway Settings Form Fields.
*/
public function init_form_fields() {
/**
* Initialise Gateway Settings Form Fields.
*/
public function init_form_fields() {

$this->form_fields = array(
$this->form_fields = array(
'enabled' => array(
'title' => __( 'Enable/Disable', 'woocommerce' ),
'type' => 'checkbox',
Expand Down Expand Up @@ -78,36 +78,36 @@ public function init_form_fields() {
'desc_tip' => true,
),
);
}
}

/**
* Output for the order received page.
*/
/**
* Output for the order received page.
*/
public function thankyou_page() {
if ( $this->instructions )
echo wpautop( wptexturize( $this->instructions ) );
echo wpautop( wptexturize( $this->instructions ) );
}

/**
* Add content to the WC emails.
*
* @access public
* @param WC_Order $order
* @param bool $sent_to_admin
* @param bool $plain_text
*/
/**
* Add content to the WC emails.
*
* @access public
* @param WC_Order $order
* @param bool $sent_to_admin
* @param bool $plain_text
*/
public function email_instructions( $order, $sent_to_admin, $plain_text = false ) {
if ( $this->instructions && ! $sent_to_admin && 'cheque' === $order->payment_method && $order->has_status( 'on-hold' ) ) {
if ( $this->instructions && ! $sent_to_admin && 'cheque' === $order->payment_method && $order->has_status( 'on-hold' ) ) {
echo wpautop( wptexturize( $this->instructions ) ) . PHP_EOL;
}
}

/**
* Process the payment and return the result.
*
* @param int $order_id
* @return array
*/
/**
* Process the payment and return the result.
*
* @param int $order_id
* @return array
*/
public function process_payment( $order_id ) {

$order = wc_get_order( $order_id );
Expand Down
Loading

0 comments on commit 7d9d091

Please sign in to comment.