PluginProbe
WCPOS – Point of Sale (POS) plugin for WooCommerce / 1.10.17
WCPOS – Point of Sale (POS) plugin for WooCommerce v1.10.17
1.10.25 1.10.24 1.10.23 1.10.22 1.10.21 1.10.20 1.10.19 1.10.18 1.10.17 1.10.16 1.10.15 1.10.13 1.10.14 1.10.12 1.10.11 1.10.10 1.10.9 1.10.8 untagged-3d9b7ccddc54df87c672 1.10.7 1.10.6 1.10.5 1.10.3 1.10.4 1.10.2 All 169 releases
← All changes | includes/Services/Tax_Id_Detector.php +8 -5 1.10.24 → 1.10.17 View file →
@@ -231,8 +231,9 @@
231 231 'limit' => $limit,
232 232 'orderby' => 'date',
233 233 'order' => 'DESC',
234 234 'status' => 'any',
235 + 'return' => 'ids',
235 236 )
236 237 );
237 238 if ( ! \is_array( $orders ) || empty( $orders ) ) {
238 239 return array();
@@ -239,16 +240,18 @@
239 240 }
240 241
241 242 // Tally populated rows per candidate.
242 243 $counts = array_fill_keys( array_keys( $candidates ), 0 );
243 - foreach ( $orders as $order ) {
244 - // Read meta through the order object: with HPOS on (and sync off) it lives
245 - // in wc_orders_meta, where get_post_meta() finds nothing.
246 - if ( ! \is_object( $order ) || ! \method_exists( $order, 'get_meta' ) ) {
244 + foreach ( $orders as $order_id ) {
245 + if ( \is_object( $order_id ) && \method_exists( $order_id, 'get_id' ) ) {
246 + $order_id = $order_id->get_id();
247 + }
248 + $meta = \get_post_meta( (int) $order_id );
249 + if ( ! \is_array( $meta ) || empty( $meta ) ) {
247 250 continue;
248 251 }
249 252 foreach ( $candidates as $meta_key => $_type ) {
250 - $value = $order->get_meta( $meta_key );
253 + $value = isset( $meta[ $meta_key ][0] ) ? $meta[ $meta_key ][0] : null;
251 254 if ( '' === $value || array() === $value || null === $value ) {
252 255 continue;
253 256 }
254 257 ++$counts[ $meta_key ];