e/blob/b8a2815ae546c836467008739e7ff5150cb08e93/includes/data-stores/class-wc-order-refund-data-store-cpt.php#L20 . '_order_currency', '_refund_amount', '_refunded_by', '_refund_reason', '_order_shipping', '_order_shipping_tax', '_order_tax', '_order_total', '_order_version', '_prices_include_tax', '_payment_tokens', ); /** * Whitelist for comment meta we are interested to sync. * * @access private * @static * * @var array */ private static $wc_comment_meta_whitelist = array( 'rating', ); /** * Return a list of objects by their type and IDs * * @param string $object_type Object type. * @param array $ids IDs of objects to return. * * @access public * * @return array|object|WP_Error|null */ public function get_objects_by_id( $object_type, $ids ) { switch ( $object_type ) { case 'order_item': return $this->get_order_item_by_ids( $ids ); } return new WP_Error( 'unsupported_object_type', 'Unsupported object type' ); } /** * Returns a list of order_item objects by their IDs. * * @param array $ids List of order_item IDs to fetch. * * @access public * * @return array|object|null */ public function get_order_item_by_ids( $ids ) { global $wpdb; if ( ! is_array( $ids ) ) { return array(); } // Make sure the IDs are numeric and are non-zero. $ids = array_filter( array_map( 'intval', $ids ) ); if ( empty( $ids ) ) { return array(); } // Prepare the placeholders for the prepared query below. $placeholders = implode( ',', array_fill( 0, count( $ids ), '%d' ) ); $query = "SELECT * FROM {$this->order_item_table_name} WHERE order_item_id IN ( $placeholders )"; // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared return $wpdb->get_results( $wpdb->prepare( $query, $ids ), ARRAY_A ); } }