This repository has been archived by the owner on May 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
76 lines (53 loc) · 1.92 KB
/
functions.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
/*
* Clears JEO default front-end styles and scripts
*/
function jeo_blank_scripts() {
// deregister jeo styles
wp_deregister_style('jeo-main');
// deregister jeo site frontend scripts
wp_deregister_script('jeo-site');
}
add_action('wp_enqueue_scripts', 'jeo_blank_scripts', 10);
/*
* JEO Hooks examples
* Most common hooks
*/
// Action right after JEO functionality inits
function jeo_blank_init() {
// Action goes here
}
add_action('jeo_init', 'jeo_blank_init');
// Hook scripts after JEO scripts has been initialized
function jeo_blank_jeo_scripts() {
// Register and enqueue scripts here
// Enqueue child theme JEO related scripts
wp_enqueue_script('jeo-blank-jeo-scripts', get_stylesheet_directory_uri() . '/js/jeo-scripts.js', array('jquery') , '0.0.1');
// Enqueue child theme main CSS
wp_enqueue_style('jeo-blank-styles', get_stylesheet_directory_uri() . '/css/main.css');
}
add_action('jeo_enqueue_scripts', 'jeo_blank_jeo_scripts', 20);
// Hook scripts after JEO Marker scripts has been initialized
function jeo_blank_markers_scripts() {
// Register and enqueue scripts here
wp_enqueue_script('jeo-blank-jeo-markers-scripts', get_stylesheet_directory_uri() . '/js/jeo-markers-scripts.js', array('jquery') , '0.0.1');
}
add_action('jeo_markers_enqueue_scripts', 'jeo_blank_markers_scripts', 20);
// Filter to change posts GeoJSON data (also changes the GeoJSON API output)
function jeo_blank_marker_data($data, $post) {
// Change $data here
return $data;
}
add_filter('jeo_marker_data', 'jeo_blank_marker_data', 10, 2);
// Filter to change GeoJSON response
function jeo_blank_markers_data($data, $query) {
// Change $data here
return $data;
}
add_filter('jeo_markers_data', 'jeo_blank_markers_data', 10, 2);
// Filter to programatically change map data
function jeo_blank_map_data($data, $map) {
// Change $data here
return $data;
}
add_filter('jeo_map_data', 'jeo_blank_map_data', 10, 2);