← All changes
|
includes/my-wordpress/integrations/woocommerce.php
+7
-5
1.1.10
→
1.1.12
View file →
| @@ -325,9 +325,9 @@ | ||
| 325 | 325 | $order = 100; |
| 326 | 326 | foreach ( ( is_wp_error( $terms ) ? array() : (array) $terms ) as $term ) { |
| 327 | 327 | $bands[] = array( |
| 328 | 328 | 'id' => 'cat:' . $term->slug, |
| 329 | - 'label' => $term->name, | |
| 329 | + 'label' => openstation_plain_text_title( $term->name ), | |
| 330 | 330 | 'order' => $order, |
| 331 | 331 | 'category' => $term->slug, |
| 332 | 332 | ); |
| 333 | 333 | $order += 10; |
| @@ -1374,9 +1374,9 @@ | ||
| 1374 | 1374 | 'rating' => (float) $product->get_average_rating(), |
| 1375 | 1375 | 'reviews' => (int) $product->get_review_count(), |
| 1376 | 1376 | 'productType' => $type_label, |
| 1377 | 1377 | 'variations' => $product->is_type( 'variable' ) ? count( $product->get_children() ) : 0, |
| 1378 | - 'categories' => is_wp_error( $categories ) ? array() : array_values( $categories ), | |
| 1378 | + 'categories' => is_wp_error( $categories ) ? array() : array_map( 'openstation_plain_text_title', array_values( $categories ) ), | |
| 1379 | 1379 | 'permalink' => (string) $product->get_permalink(), |
| 1380 | 1380 | 'editUrl' => (string) get_edit_post_link( $product->get_id(), 'raw' ), |
| 1381 | 1381 | ); |
| 1382 | 1382 | } |
| @@ -1405,9 +1405,9 @@ | ||
| 1405 | 1405 | $product_id = method_exists( $item, 'get_product_id' ) ? (int) $item->get_product_id() : 0; |
| 1406 | 1406 | // Variations edit through their parent product's screen. |
| 1407 | 1407 | $edit_id = $product_id; |
| 1408 | 1408 | $items[] = array( |
| 1409 | - 'name' => $item->get_name(), | |
| 1409 | + 'name' => openstation_plain_text_title( $item->get_name() ), | |
| 1410 | 1410 | 'quantity' => (int) $item->get_quantity(), |
| 1411 | 1411 | 'total' => openstation_my_wordpress_woo_price( $item->get_total(), $order->get_currency() ), |
| 1412 | 1412 | 'id' => $product_id, |
| 1413 | 1413 | // A line item whose product has since been deleted has no |
| @@ -1555,9 +1555,9 @@ | ||
| 1555 | 1555 | foreach ( $ids as $id ) { |
| 1556 | 1556 | $term = get_term( (int) $id, $taxonomy ); |
| 1557 | 1557 | if ( $term && ! is_wp_error( $term ) ) { |
| 1558 | 1558 | $out[] = array( |
| 1559 | - 'label' => $term->name, | |
| 1559 | + 'label' => openstation_plain_text_title( $term->name ), | |
| 1560 | 1560 | 'editUrl' => (string) get_edit_term_link( $term->term_id, $taxonomy ), |
| 1561 | 1561 | ); |
| 1562 | 1562 | } |
| 1563 | 1563 | } |
| @@ -1569,9 +1569,9 @@ | ||
| 1569 | 1569 | foreach ( $ids as $id ) { |
| 1570 | 1570 | $product = wc_get_product( (int) $id ); |
| 1571 | 1571 | if ( $product ) { |
| 1572 | 1572 | $out[] = array( |
| 1573 | - 'label' => $product->get_name(), | |
| 1573 | + 'label' => openstation_plain_text_title( $product->get_name() ), | |
| 1574 | 1574 | 'editUrl' => (string) get_edit_post_link( $product->get_id(), 'raw' ), |
| 1575 | 1575 | ); |
| 1576 | 1576 | } |
| 1577 | 1577 | } |
| @@ -1978,8 +1978,10 @@ | ||
| 1978 | 1978 | 'restNonce' => wp_create_nonce( 'wp_rest' ), |
| 1979 | 1979 | 'canOrders' => true === openstation_my_wordpress_woo_orders_permission(), |
| 1980 | 1980 | 'canCustomers' => true === openstation_my_wordpress_woo_customers_permission(), |
| 1981 | 1981 | 'orderBands' => openstation_my_wordpress_woo_order_bands(), |
| 1982 | + // `wc-` slug → label, for the Orders list view. | |
| 1983 | + 'orderStatuses' => wc_get_order_statuses(), | |
| 1982 | 1984 | 'productBands' => openstation_my_wordpress_woo_product_bands(), |
| 1983 | 1985 | 'couponBands' => openstation_my_wordpress_woo_coupon_bands_with_counts(), |
| 1984 | 1986 | // Only built for a viewer who may see them — the |
| 1985 | 1987 | // band counts are money, and the plan behind them |