' . str_replace("\n\n", '
', $text) . '
'; } function sanitize_key($text) { return preg_replace('/[^a-z0-9_\-]/', '', strtolower((string) $text)); } function sanitize_text_field($text) { return trim(strip_tags((string) $text)); } function wp_unslash($text) { return stripslashes((string) $text); } function absint($value) { return abs((int) $value); } function selected($a, $b, $echo = true) { return (string) $a === (string) $b ? ' selected="selected"' : ''; } function number_format_i18n($number) { return number_format($number); } function admin_url($path) { return 'https://example.test/wp-admin/' . $path; } function rest_url($path) { return 'https://example.test/wp-json/' . $path; } function get_current_user_id() { return 7; } function wp_get_current_user() { return (object) ['ID' => 7, 'display_name' => 'Operator']; } function get_users($args) { return [(object) ['ID' => 7, 'display_name' => 'Operator'], (object) ['ID' => 8, 'display_name' => 'Second']]; } function get_edit_user_link($id) { return admin_url('user-edit.php?user_id=' . $id); } function aksrt_get_avatar_url($id, $size) { return 'https://example.test/avatar/' . $id; } function current_user_can($cap) { return $GLOBALS['allowed']; } function check_ajax_referer($action, $key, $die) { return $action === 'aksrt_ticket_view' && $key === 'nonce' && $GLOBALS['valid_nonce']; } function add_query_arg($args, $url, $base = null) { if (!is_array($args)) { $args = [$args => $url]; $url = $base; } $parts = parse_url($url); parse_str($parts['query'] ?? '', $query); return $parts['scheme'] . '://' . $parts['host'] . ($parts['path'] ?? '') . '?' . http_build_query(array_merge($query, $args)); } class JsonReply extends \Exception { public function __construct(public array $payload, public int $status) { parent::__construct(); } } function wp_send_json_success($data) { throw new JsonReply(['success' => true, 'data' => $data], 200); } function wp_send_json_error($data, $status) { throw new JsonReply(['success' => false, 'data' => $data], $status); } } namespace AKSRT\Ticket { class TicketSettings { public static bool $orders = true; public static function title_max() { return 100; } public static function content_max() { return 1000; } public static function reply_max() { return 500; } public static function order_link_enabled() { return self::$orders; } } class TicketTypeService { public static bool $empty = false; public static function all() { return self::$empty ? [] : [['id' => 1, 'name' => 'Support ']]; } } class TicketNoteService { public static function for_ticket($id) { return [['admin_name' => 'Admin