Fixed coding standards

This commit is contained in:
Claudio Sanches 2017-12-21 15:53:12 -02:00
parent c18cc47286
commit 71a1fd319e
1 changed files with 27 additions and 15 deletions

View File

@ -16,7 +16,7 @@ if ( ! defined( 'ABSPATH' ) ) {
* Include dependencies. * Include dependencies.
*/ */
if ( ! class_exists( 'WC_CSV_Batch_Exporter', false ) ) { if ( ! class_exists( 'WC_CSV_Batch_Exporter', false ) ) {
include_once( WC_ABSPATH . 'includes/export/abstract-wc-csv-batch-exporter.php' ); include_once WC_ABSPATH . 'includes/export/abstract-wc-csv-batch-exporter.php';
} }
/** /**
@ -98,9 +98,13 @@ class WC_Product_CSV_Exporter extends WC_CSV_Batch_Exporter {
'stock' => __( 'Stock', 'woocommerce' ), 'stock' => __( 'Stock', 'woocommerce' ),
'backorders' => __( 'Backorders allowed?', 'woocommerce' ), 'backorders' => __( 'Backorders allowed?', 'woocommerce' ),
'sold_individually' => __( 'Sold individually?', 'woocommerce' ), 'sold_individually' => __( 'Sold individually?', 'woocommerce' ),
/* translators: %s: weight */
'weight' => sprintf( __( 'Weight (%s)', 'woocommerce' ), get_option( 'woocommerce_weight_unit' ) ), 'weight' => sprintf( __( 'Weight (%s)', 'woocommerce' ), get_option( 'woocommerce_weight_unit' ) ),
/* translators: %s: length */
'length' => sprintf( __( 'Length (%s)', 'woocommerce' ), get_option( 'woocommerce_dimension_unit' ) ), 'length' => sprintf( __( 'Length (%s)', 'woocommerce' ), get_option( 'woocommerce_dimension_unit' ) ),
/* translators: %s: width */
'width' => sprintf( __( 'Width (%s)', 'woocommerce' ), get_option( 'woocommerce_dimension_unit' ) ), 'width' => sprintf( __( 'Width (%s)', 'woocommerce' ), get_option( 'woocommerce_dimension_unit' ) ),
/* translators: %s: Height */
'height' => sprintf( __( 'Height (%s)', 'woocommerce' ), get_option( 'woocommerce_dimension_unit' ) ), 'height' => sprintf( __( 'Height (%s)', 'woocommerce' ), get_option( 'woocommerce_dimension_unit' ) ),
'reviews_allowed' => __( 'Allow customer reviews?', 'woocommerce' ), 'reviews_allowed' => __( 'Allow customer reviews?', 'woocommerce' ),
'purchase_note' => __( 'Purchase note', 'woocommerce' ), 'purchase_note' => __( 'Purchase note', 'woocommerce' ),
@ -477,7 +481,9 @@ class WC_Product_CSV_Exporter extends WC_CSV_Batch_Exporter {
if ( $downloads ) { if ( $downloads ) {
$i = 1; $i = 1;
foreach ( $downloads as $download ) { foreach ( $downloads as $download ) {
/* translators: %s: download number */
$this->column_names[ 'downloads:name' . $i ] = sprintf( __( 'Download %d name', 'woocommerce' ), $i ); $this->column_names[ 'downloads:name' . $i ] = sprintf( __( 'Download %d name', 'woocommerce' ), $i );
/* translators: %s: download number */
$this->column_names[ 'downloads:url' . $i ] = sprintf( __( 'Download %d URL', 'woocommerce' ), $i ); $this->column_names[ 'downloads:url' . $i ] = sprintf( __( 'Download %d URL', 'woocommerce' ), $i );
$row[ 'downloads:name' . $i ] = $download->get_name(); $row[ 'downloads:name' . $i ] = $download->get_name();
$row[ 'downloads:url' . $i ] = $download->get_file(); $row[ 'downloads:url' . $i ] = $download->get_file();
@ -502,9 +508,13 @@ class WC_Product_CSV_Exporter extends WC_CSV_Batch_Exporter {
if ( count( $attributes ) ) { if ( count( $attributes ) ) {
$i = 1; $i = 1;
foreach ( $attributes as $attribute_name => $attribute ) { foreach ( $attributes as $attribute_name => $attribute ) {
/* translators: %s: attribute number */
$this->column_names[ 'attributes:name' . $i ] = sprintf( __( 'Attribute %d name', 'woocommerce' ), $i ); $this->column_names[ 'attributes:name' . $i ] = sprintf( __( 'Attribute %d name', 'woocommerce' ), $i );
/* translators: %s: attribute number */
$this->column_names[ 'attributes:value' . $i ] = sprintf( __( 'Attribute %d value(s)', 'woocommerce' ), $i ); $this->column_names[ 'attributes:value' . $i ] = sprintf( __( 'Attribute %d value(s)', 'woocommerce' ), $i );
/* translators: %s: attribute number */
$this->column_names[ 'attributes:visible' . $i ] = sprintf( __( 'Attribute %d visible', 'woocommerce' ), $i ); $this->column_names[ 'attributes:visible' . $i ] = sprintf( __( 'Attribute %d visible', 'woocommerce' ), $i );
/* translators: %s: attribute number */
$this->column_names[ 'attributes:taxonomy' . $i ] = sprintf( __( 'Attribute %d global', 'woocommerce' ), $i ); $this->column_names[ 'attributes:taxonomy' . $i ] = sprintf( __( 'Attribute %d global', 'woocommerce' ), $i );
if ( is_a( $attribute, 'WC_Product_Attribute' ) ) { if ( is_a( $attribute, 'WC_Product_Attribute' ) ) {
@ -542,6 +552,7 @@ class WC_Product_CSV_Exporter extends WC_CSV_Batch_Exporter {
} }
if ( $product->is_type( 'variable' ) && isset( $default_attributes[ sanitize_title( $attribute_name ) ] ) ) { if ( $product->is_type( 'variable' ) && isset( $default_attributes[ sanitize_title( $attribute_name ) ] ) ) {
/* translators: %s: attribute number */
$this->column_names[ 'attributes:default' . $i ] = sprintf( __( 'Attribute %d default', 'woocommerce' ), $i ); $this->column_names[ 'attributes:default' . $i ] = sprintf( __( 'Attribute %d default', 'woocommerce' ), $i );
$default_value = $default_attributes[ sanitize_title( $attribute_name ) ]; $default_value = $default_attributes[ sanitize_title( $attribute_name ) ];
@ -586,6 +597,7 @@ class WC_Product_CSV_Exporter extends WC_CSV_Batch_Exporter {
} }
$column_key = 'meta:' . esc_attr( $meta->key ); $column_key = 'meta:' . esc_attr( $meta->key );
/* translators: %s: meta data name */
$this->column_names[ $column_key ] = sprintf( __( 'Meta: %s', 'woocommerce' ), $meta->key ); $this->column_names[ $column_key ] = sprintf( __( 'Meta: %s', 'woocommerce' ), $meta->key );
$row[ $column_key ] = $meta_value; $row[ $column_key ] = $meta_value;
$i ++; $i ++;