| 1 |
<?php |
| 2 |
/** |
| 3 |
* @package Awesome Support/Admin/Functions/Agent-Chat |
| 4 |
* @author AwesomeSupport <contact@getawesomesupport.com> |
| 5 |
* @license GPL-2.0+ |
| 6 |
* @link https://getawesomesupport.com |
| 7 |
* @copyright 2015-2018 AwesomeSupport |
| 8 |
*/ |
| 9 |
|
| 10 |
// If this file is called directly, abort. |
| 11 |
if ( ! defined( 'WPINC' ) ) { |
| 12 |
die; |
| 13 |
} |
| 14 |
|
| 15 |
/** |
| 16 |
* Register teamviewer integration script |
| 17 |
* |
| 18 |
* @since 4.4.0 |
| 19 |
* |
| 20 |
* @return void |
| 21 |
*/ |
| 22 |
add_action( 'admin_enqueue_scripts', 'wpas_enqueue_team_viewer_scripts', 10 ); |
| 23 |
function wpas_enqueue_team_viewer_scripts(){ |
| 24 |
|
| 25 |
if ( true === boolval( wpas_get_option( 'enable_teamviewer_chat', false ) && true == wpas_is_plugin_page() ) ) { |
| 26 |
|
| 27 |
wp_register_script( 'wpas-teamviewer-chat', 'https://integratedchat.teamviewer.com/widget', '', '4.4.0', true ); |
| 28 |
wp_enqueue_script( 'wpas-teamviewer-chat' ); |
| 29 |
|
| 30 |
} |
| 31 |
|
| 32 |
} |