This commit is contained in:
Albert Juhé Lluveras 2019-04-10 10:49:00 +02:00 committed by GitHub
parent 704e3aec1a
commit 5ae9ee65b0
7 changed files with 19 additions and 19 deletions

View File

@ -451,7 +451,7 @@ class WC_Admin_REST_Leaderboards_Controller extends WC_REST_Data_Controller {
), ),
), ),
), ),
'rows' => array( 'rows' => array(
'type' => 'array', 'type' => 'array',
'description' => __( 'Table rows.', 'woocommerce-admin' ), 'description' => __( 'Table rows.', 'woocommerce-admin' ),
'context' => array( 'view' ), 'context' => array( 'view' ),

View File

@ -240,13 +240,13 @@ class WC_Admin_REST_Onboarding_Levels_Controller extends WC_REST_Data_Controller
'context' => array( 'view', 'edit' ), 'context' => array( 'view', 'edit' ),
'readonly' => true, 'readonly' => true,
), ),
'illustration' => array( 'illustration' => array(
'description' => __( 'URL for illustration used.', 'woocommerce-admin' ), 'description' => __( 'URL for illustration used.', 'woocommerce-admin' ),
'type' => 'string', 'type' => 'string',
'context' => array( 'view', 'edit' ), 'context' => array( 'view', 'edit' ),
'readonly' => true, 'readonly' => true,
), ),
'status' => array( 'status' => array(
'description' => __( 'Task status.', 'woocommerce-admin' ), 'description' => __( 'Task status.', 'woocommerce-admin' ),
'type' => 'string', 'type' => 'string',
'context' => array( 'view', 'edit' ), 'context' => array( 'view', 'edit' ),

View File

@ -355,32 +355,32 @@ class WC_Admin_REST_Reports_Customers_Controller extends WC_REST_Reports_Control
'email', 'email',
), ),
); );
$params['name_includes'] = array( $params['name_includes'] = array(
'description' => __( 'Limit response to objects with specfic names.', 'woocommerce-admin' ), 'description' => __( 'Limit response to objects with specfic names.', 'woocommerce-admin' ),
'type' => 'string', 'type' => 'string',
'validate_callback' => 'rest_validate_request_arg', 'validate_callback' => 'rest_validate_request_arg',
); );
$params['name_excludes'] = array( $params['name_excludes'] = array(
'description' => __( 'Limit response to objects excluding specfic names.', 'woocommerce-admin' ), 'description' => __( 'Limit response to objects excluding specfic names.', 'woocommerce-admin' ),
'type' => 'string', 'type' => 'string',
'validate_callback' => 'rest_validate_request_arg', 'validate_callback' => 'rest_validate_request_arg',
); );
$params['username_includes'] = array( $params['username_includes'] = array(
'description' => __( 'Limit response to objects with specfic usernames.', 'woocommerce-admin' ), 'description' => __( 'Limit response to objects with specfic usernames.', 'woocommerce-admin' ),
'type' => 'string', 'type' => 'string',
'validate_callback' => 'rest_validate_request_arg', 'validate_callback' => 'rest_validate_request_arg',
); );
$params['username_excludes'] = array( $params['username_excludes'] = array(
'description' => __( 'Limit response to objects excluding specfic usernames.', 'woocommerce-admin' ), 'description' => __( 'Limit response to objects excluding specfic usernames.', 'woocommerce-admin' ),
'type' => 'string', 'type' => 'string',
'validate_callback' => 'rest_validate_request_arg', 'validate_callback' => 'rest_validate_request_arg',
); );
$params['email_includes'] = array( $params['email_includes'] = array(
'description' => __( 'Limit response to objects including emails.', 'woocommerce-admin' ), 'description' => __( 'Limit response to objects including emails.', 'woocommerce-admin' ),
'type' => 'string', 'type' => 'string',
'validate_callback' => 'rest_validate_request_arg', 'validate_callback' => 'rest_validate_request_arg',
); );
$params['email_excludes'] = array( $params['email_excludes'] = array(
'description' => __( 'Limit response to objects excluding emails.', 'woocommerce-admin' ), 'description' => __( 'Limit response to objects excluding emails.', 'woocommerce-admin' ),
'type' => 'string', 'type' => 'string',
'validate_callback' => 'rest_validate_request_arg', 'validate_callback' => 'rest_validate_request_arg',

View File

@ -216,32 +216,32 @@ class WC_Admin_REST_Reports_Customers_Stats_Controller extends WC_REST_Reports_C
'email', 'email',
), ),
); );
$params['name_includes'] = array( $params['name_includes'] = array(
'description' => __( 'Limit response to objects with specfic names.', 'woocommerce-admin' ), 'description' => __( 'Limit response to objects with specfic names.', 'woocommerce-admin' ),
'type' => 'string', 'type' => 'string',
'validate_callback' => 'rest_validate_request_arg', 'validate_callback' => 'rest_validate_request_arg',
); );
$params['name_excludes'] = array( $params['name_excludes'] = array(
'description' => __( 'Limit response to objects excluding specfic names.', 'woocommerce-admin' ), 'description' => __( 'Limit response to objects excluding specfic names.', 'woocommerce-admin' ),
'type' => 'string', 'type' => 'string',
'validate_callback' => 'rest_validate_request_arg', 'validate_callback' => 'rest_validate_request_arg',
); );
$params['username_includes'] = array( $params['username_includes'] = array(
'description' => __( 'Limit response to objects with specfic usernames.', 'woocommerce-admin' ), 'description' => __( 'Limit response to objects with specfic usernames.', 'woocommerce-admin' ),
'type' => 'string', 'type' => 'string',
'validate_callback' => 'rest_validate_request_arg', 'validate_callback' => 'rest_validate_request_arg',
); );
$params['username_excludes'] = array( $params['username_excludes'] = array(
'description' => __( 'Limit response to objects excluding specfic usernames.', 'woocommerce-admin' ), 'description' => __( 'Limit response to objects excluding specfic usernames.', 'woocommerce-admin' ),
'type' => 'string', 'type' => 'string',
'validate_callback' => 'rest_validate_request_arg', 'validate_callback' => 'rest_validate_request_arg',
); );
$params['email_includes'] = array( $params['email_includes'] = array(
'description' => __( 'Limit response to objects including emails.', 'woocommerce-admin' ), 'description' => __( 'Limit response to objects including emails.', 'woocommerce-admin' ),
'type' => 'string', 'type' => 'string',
'validate_callback' => 'rest_validate_request_arg', 'validate_callback' => 'rest_validate_request_arg',
); );
$params['email_excludes'] = array( $params['email_excludes'] = array(
'description' => __( 'Limit response to objects excluding emails.', 'woocommerce-admin' ), 'description' => __( 'Limit response to objects excluding emails.', 'woocommerce-admin' ),
'type' => 'string', 'type' => 'string',
'validate_callback' => 'rest_validate_request_arg', 'validate_callback' => 'rest_validate_request_arg',

View File

@ -180,7 +180,7 @@ class WC_Admin_REST_Reports_Orders_Stats_Controller extends WC_Admin_REST_Report
'context' => array( 'view', 'edit' ), 'context' => array( 'view', 'edit' ),
'readonly' => true, 'readonly' => true,
), ),
'coupons' => array( 'coupons' => array(
'description' => __( 'Amount discounted by coupons.', 'woocommerce-admin' ), 'description' => __( 'Amount discounted by coupons.', 'woocommerce-admin' ),
'type' => 'number', 'type' => 'number',
'context' => array( 'view', 'edit' ), 'context' => array( 'view', 'edit' ),

View File

@ -152,7 +152,7 @@ class WC_Admin_REST_Reports_Revenue_Stats_Controller extends WC_REST_Reports_Con
'indicator' => true, 'indicator' => true,
'format' => 'currency', 'format' => 'currency',
), ),
'coupons' => array( 'coupons' => array(
'description' => __( 'Amount discounted by coupons.', 'woocommerce-admin' ), 'description' => __( 'Amount discounted by coupons.', 'woocommerce-admin' ),
'type' => 'number', 'type' => 'number',
'context' => array( 'view', 'edit' ), 'context' => array( 'view', 'edit' ),

View File

@ -123,8 +123,8 @@ class WC_Admin_Notes_Order_Milestones {
*/ */
public function get_orders_count( $no_cache = false ) { public function get_orders_count( $no_cache = false ) {
if ( $no_cache || is_null( $this->orders_count ) ) { if ( $no_cache || is_null( $this->orders_count ) ) {
$status_counts = array_map( 'wc_orders_count', $this->allowed_statuses ); $status_counts = array_map( 'wc_orders_count', $this->allowed_statuses );
$this->orders_count = array_sum( $status_counts ); $this->orders_count = array_sum( $status_counts );
} }
return $this->orders_count; return $this->orders_count;