fixed coding standards

This commit is contained in:
claudiosmweb 2013-12-30 14:28:39 -02:00
parent b68b6f2faf
commit 9aaa8c8875
1 changed files with 13 additions and 8 deletions

View File

@ -1,9 +1,11 @@
<?php <?php
if ( ! defined( 'ABSPATH' ) ) if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly exit; // Exit if accessed directly
}
if ( ! class_exists( 'WP_List_Table' ) ) if ( ! class_exists( 'WP_List_Table' ) ) {
require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' ); require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
}
/** /**
* WC_Report_Customer_List class * WC_Report_Customer_List class
@ -68,10 +70,11 @@ class WC_Report_Customer_List extends WP_List_Table {
switch( $column_name ) { switch( $column_name ) {
case 'customer_name' : case 'customer_name' :
if ( $user->last_name && $user->first_name ) if ( $user->last_name && $user->first_name ) {
return $user->last_name . ', ' . $user->first_name; return $user->last_name . ', ' . $user->first_name;
else } else {
return '-'; return '-';
}
case 'username' : case 'username' :
return $user->user_login; return $user->user_login;
break; break;
@ -80,20 +83,22 @@ class WC_Report_Customer_List extends WP_List_Table {
$state_code = get_user_meta( $user->ID, 'billing_state', true ); $state_code = get_user_meta( $user->ID, 'billing_state', true );
$country_code = get_user_meta( $user->ID, 'billing_country', true ); $country_code = get_user_meta( $user->ID, 'billing_country', true );
$state = isset( WC()->countries->states[$country_code][ $state_code ] ) ? WC()->countries->states[ $country_code ][ $state_code ] : $state_code; $state = isset( WC()->countries->states[ $country_code ][ $state_code ] ) ? WC()->countries->states[ $country_code ][ $state_code ] : $state_code;
$country = isset( WC()->countries->countries[ $country_code ] ) ? WC()->countries->countries[ $country_code ] : $country_code; $country = isset( WC()->countries->countries[ $country_code ] ) ? WC()->countries->countries[ $country_code ] : $country_code;
$value = ''; $value = '';
if ( $state ) if ( $state ) {
$value .= $state . ', '; $value .= $state . ', ';
}
$value .= $country; $value .= $country;
if ( $value ) if ( $value ) {
return $value; return $value;
else } else {
return '-'; return '-';
}
break; break;
case 'email' : case 'email' :
return '<a href="mailto:' . $user->user_email . '">' . $user->user_email . '</a>'; return '<a href="mailto:' . $user->user_email . '">' . $user->user_email . '</a>';