timeslot_text; } return $meta_value; } public static function woocommerce_order_item_display_custom_field_meta_value( $meta_value ) { remove_filter('woocommerce_order_item_display_meta_value', array('Booked_WC_Order_Item_Hooks', 'woocommerce_order_item_display_custom_field_meta_value'), 10, 1); $separator = '--SEP--'; $parts = explode($separator, $meta_value); $meta_value = $parts[0] . ':' . $parts[1]; return $meta_value; } // changes the Order Item app_id to text in Back End public static function pre_kses($string, $allowed_html, $allowed_protocols) { if ( $string===__('Appointment', 'booked-woocommerce-payments') ) { return $string; } remove_filter('pre_kses', array('Booked_WC_Order_Item_Hooks', 'pre_kses'), 10, 3); $app_id = intval(strip_tags($string)); if ( !$app_id ) { return $string; } try { $appointment = Booked_WC_Appointment::get($app_id); } catch (Exception $e) { $appointment = false; } if ( $appointment ) { $string = $appointment->timeslot_text; } return $string; } // change the product title on the order details page if it is assigned to a appointment public static function woocommerce_order_item_name($title, $item) { if ( isset($item['booked_wc_appointment_id']) ) { // remove product title link, so the visitors can't acess the product details page $title = preg_replace('~]+>([^<]+)~i', '$1', $title); } return $title; } }