WC_API_XML_Handler::format_sales_report_data()
Adjust the sales report array format to change totals keyed with the sales date to become an attribute for the totals element instead
Метод класса: WC_API_XML_Handler{}
Хуков нет.
Возвращает
Массив
.
Использование
$WC_API_XML_Handler = new WC_API_XML_Handler(); $WC_API_XML_Handler->format_sales_report_data( $data );
- $data(массив) (обязательный)
- -
Список изменений
С версии 2.1 | Введена. |
Код WC_API_XML_Handler::format_sales_report_data() WC API XML Handler::format sales report data WC 7.7.2
public function format_sales_report_data( $data ) { if ( ! empty( $data['totals'] ) ) { foreach ( $data['totals'] as $date => $totals ) { unset( $data['totals'][ $date ] ); $data['totals'][] = array_merge( array( '@attributes' => array( 'date' => $date ) ), $totals ); } } return $data; }