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 '
You must be logged in to access the browser phone.
'; } // Check if user has permission if (!current_user_can('twp_access_browser_phone') && !current_user_can('manage_options')) { return '
You don\'t have permission to access the browser phone.
'; } // Parse shortcode attributes $atts = shortcode_atts(array( 'title' => 'Browser Phone', 'show_title' => 'true', 'compact' => 'false' ), $atts, 'twp_browser_phone'); $show_title = ($atts['show_title'] === 'true'); $compact_mode = ($atts['compact'] === 'true'); ob_start(); ?>

Connecting...

Your Queues

Loading queues...