-
Notifications
You must be signed in to change notification settings - Fork 13
/
ultimate-addons-elementor.php
56 lines (49 loc) · 1.42 KB
/
ultimate-addons-elementor.php
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
54
55
56
<?php
defined( 'ABSPATH' ) or die( "you do not have acces to this page!" );
function cmplz_uafe_initDomContentLoaded() {
if ( cmplz_uses_thirdparty('youtube') ) {
?>
<script>
document.addEventListener("cmplz_run_after_all_scripts", cmplz_uafe_fire_initOnReadyComponents);
function cmplz_uafe_fire_initOnReadyComponents() {
window.elementorFrontend.init();
}
</script>
<?php
}
}
add_action( 'wp_footer', 'cmplz_uafe_initDomContentLoaded' );
add_filter( 'cmplz_known_script_tags', 'cmplz_uafe_script' );
function cmplz_uafe_script( $tags ) {
$tags[] = array(
'name' => 'google-maps',
'category' => 'marketing',
'placeholder' => 'google-maps',
'urls' => array(
'uael-google-map.js',
'maps.googleapis.com',
),
'enable_placeholder' => '1',
'placeholder_class' => 'uael-google-map-wrap',
'enable_dependency' => '1',
'dependency' => [
//'wait-for-this-script' => 'script-that-should-wait'
'maps.googleapis.com' => 'uael-google-map.js'
],
);
return $tags;
}
/**
* Add services to the list of detected items, so it will get set as default, and will be added to the notice about it
*
* @param $services
*
* @return array
*/
function cmplz_uafe_detected_services( $services ) {
if ( ! in_array( 'google-maps', $services ) ) {
$services[] = 'google-maps';
}
return $services;
}
add_filter( 'cmplz_detected_services', 'cmplz_uafe_detected_services' );