woocommerce_reports_order_statuses

woocommerce_reports_order_statuses

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.8.7.0

apply_filters('woocommerce_reports_order_statuses') is found 2 times:

  • /includes/admin/class-wc-admin-dashboard.php line 91

    $query[‘join’] = “INNER JOIN {$wpdb->prefix}woocommerce_order_items AS order_items ON posts.ID = order_id “;
    $query[‘join’] .= “INNER JOIN {$wpdb->prefix}woocommerce_order_itemmeta AS order_item_meta ON order_items.order_item_id = order_item_meta.order_item_id “;
    $query[‘join’] .= “INNER JOIN {$wpdb->prefix}woocommerce_order_itemmeta AS order_item_meta_2 ON order_items.order_item_id = order_item_meta_2.order_item_id “;
    $query[‘where’] = “WHERE posts.post_type IN ( ‘” . implode( “‘,'”, wc_get_order_types( ‘order-count’ ) ) . “‘ ) “;
    $query[‘where’] .= “AND posts.post_status IN ( ‘wc-” . implode( “‘,’wc-“, apply_filters( ‘woocommerce_reports_order_statuses’, array( ‘completed’, ‘processing’, ‘on-hold’ ) ) ) . “‘ ) “;
    $query[‘where’] .= “AND order_item_meta.meta_key = ‘_qty’ “;
    $query[‘where’] .= “AND order_item_meta_2.meta_key = ‘_product_id’ “;
    $query[‘where’] .= “AND posts.post_date >= ‘” . gmdate( ‘Y-m-01’, current_time( ‘timestamp’ ) ) . “‘ “;
    $query[‘where’] .= “AND posts.post_date <= '" . gmdate( 'Y-m-d H:i:s', current_time( 'timestamp' ) ) . "' "; $query['groupby'] = 'GROUP BY product_id'; $query['orderby'] = 'ORDER BY qty DESC'; [/php]

  • /includes/admin/reports/class-wc-admin-report.php line 122
    		if ( empty( $data ) ) {
    			return '';
    		}
    
    		$order_status = apply_filters( 'woocommerce_reports_order_statuses', $order_status );
    
    		$query  = array();
    		$select = array();
    
    		foreach ( $data as $raw_key => $value ) {
    			$key      = sanitize_key( $raw_key );