post_content, 'twp_browser_phone')) { // Enqueue Twilio Voice SDK wp_enqueue_script( 'twilio-voice-sdk', 'https://sdk.twilio.com/js/voice/2.11.1/twilio.min.js', array(), '2.11.1', true ); // Enqueue our browser phone script wp_enqueue_script( 'twp-browser-phone-frontend', TWP_PLUGIN_URL . 'assets/js/browser-phone-frontend.js', array('jquery', 'twilio-voice-sdk'), TWP_VERSION, true ); // Enqueue mobile-friendly styles wp_enqueue_style( 'twp-browser-phone-frontend', TWP_PLUGIN_URL . 'assets/css/browser-phone-frontend.css', array(), TWP_VERSION ); // Localize script with AJAX data wp_localize_script('twp-browser-phone-frontend', 'twp_frontend_ajax', array( 'ajax_url' => admin_url('admin-ajax.php'), 'nonce' => wp_create_nonce('twp_frontend_nonce'), 'user_id' => get_current_user_id(), 'is_logged_in' => is_user_logged_in() )); } } /** * Browser phone shortcode handler */ public static function browser_phone_shortcode($atts) { // Check if user is logged in if (!is_user_logged_in()) { return '