-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathyt-api-avoid-conflicts.php
More file actions
53 lines (48 loc) · 1.3 KB
/
Copy pathyt-api-avoid-conflicts.php
File metadata and controls
53 lines (48 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
/**
* YT API Avoid Conflicts
*
* @package YT API Avoid Conflicts
* @author Push Labs
* @copyright 2018 Push Labs
* @license MIT
*
* @wordpress-plugin
* Plugin Name: YT API Avoid Conflicts
* Description: A WordPress plugin to avoid conflicts with the onYouTubePlayerAPIReady() YouTube API function
* Author: Push Labs
* Version: 1.0.0
* Author URI: https://pushlabs.co
*/
define( 'YTAAC_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
define( 'YTAAC_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
define( 'YTAAC_PLUGIN_VERSION', '1.0.0' );
/**
* Our class to include YTAAC.
*
* @since 1.0.0 Introduced
*
* @return Void
*/
class PushLabs_YT_Api_Avoid_Conflicts {
/**
* Run our hooks.
*
* @since 1.0.0 Introduction
*
* @return Void
*/
public function __construct() {
// Add the hook for the avoid conflicts script and set the priority to 9999 to make it execute last.
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ), 9999 );
}
/**
* Enqueue the avoid conflicts script
*
* @return void
*/
public function enqueue_scripts() {
wp_enqueue_script( 'yt-api-avoid-conflicts', YTAAC_PLUGIN_URL . 'assets/js/YTApiAvoidConflicts.js', array(), YTAAC_PLUGIN_VERSION, true );
}
}
$pushlabs_yt_api_avoid_conflicts = new PushLabs_YT_Api_Avoid_Conflicts();