-
Notifications
You must be signed in to change notification settings - Fork 33
Action Hooks
Miguel Peixe edited this page Aug 4, 2015
·
4 revisions
This action is called after JEO has loaded. Useful for plugging new features for JEO.
<?php
function my_jeo_plugin_init() {
// Do something here
}
add_action('jeo_init', 'my_jeo_plugin_init');
?>
This action is called after JEO core scripts has been loaded.
<?php
function my_jeo_scripts() {
wp_enqueue_script('jeo-dependent-script', get_stylesheet_directory_uri() . '/js/script.js');
}
add_action('jeo_enqueue_scripts', 'my_jeo_scripts');
?>
This action is called inside the map settings metabox. You can create extra fields for your map by hooking into this action.
This action receives 1 parameter:
-
$map_data
: The map data of the map being edited
<?php
function my_new_setting($map_data) {
?>
<p>
<label for="my_new_field">My field</label>
<input id="my_new_field" type="text" name="map_data[my_new_field]" value="<?php echo $map_data['my_new_field']; ?>" />
</p>
<?php
}
add_action('jeo_map_setup_options', 'my_new_setting');
?>
This action is called inside the map query. Useful to modify the map query.
This action receives 1 parameter:
-
$query
: the map query
<?php
function my_pre_get_map($query) {
if($_GET['my_input']) {
// Modifying query here
}
}
add_action('jeo_pre_get_map', 'my_pre_get_map');
?>
This action is called before the embed template is displayed.
<?php
function my_before_embed_content() {
?>
<p>Some content here</p>
<?php
}
add_action('jeo_before_embed', 'my_before_embed_content');
?>
This action is called after the embed template is displayed.
<?php
function my_after_embed_content() {
?>
<p>Some content here</p>
<?php
}
add_action('jeo_after_embed', 'my_before_embed_content');
?>