settings['url'];
// register & include JS
wp_register_script( 'jquery', 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.slim.min.js', array(), null, true );
wp_register_script( 'leaflet', 'https://cdn.jsdelivr.net/leaflet/1/leaflet.js', array(), null, true );
wp_register_script( 'places', 'https://cdn.jsdelivr.net/npm/places.js@1.6.0', array(), null, true );
wp_register_script( 'leaflet-providers', $url . "assets/js/leaflet-providers.min.js", array('leaflet'), null, true );
wp_register_script( 'input', $url . "assets/js/input.js", array('jquery', 'leaflet', 'leaflet-providers', 'places'), null, true );
if ( !wp_script_is( 'jquery', 'enqueued' ) )
wp_enqueue_script( 'jquery' );
wp_enqueue_script( 'leaflet' );
wp_enqueue_script( 'input' );
wp_enqueue_script( 'places' );
wp_enqueue_script( 'leaflet-providers' );
// register & include CSS
wp_register_style( 'leaflet', "https://cdn.jsdelivr.net/leaflet/1/leaflet.css", array(), null );
wp_enqueue_style( 'leaflet' );
}
/**
* This action is called in the admin_footer action on the edit screen where your field is created.
* Use this action to add CSS and JavaScript to assist your render_field() action.
*
*/
/*function input_admin_footer() {
}*/
/**
* This action is called in the admin_head action on the edit screen where your field is created.
* Use this action to add CSS and JavaScript to assist your render_field() action.
*/
/*function input_admin_head() {
}*/
/**
* This function is called once on the 'input' page between the head and footer
* There are 2 situations where ACF did not load during the 'acf/input_admin_enqueue_scripts' and
* 'acf/input_admin_head' actions because ACF did not know it was going to be used. These situations are
* seen on comments / user edit forms on the front end. This function will always be called, and includes
* $args that related to the current screen such as $args['post_id']
*
* @param $args (array)
*/
/*function input_form_data( $args ) {
}*/
/**
* This action is called in the admin_enqueue_scripts action on the edit screen where your field is edited.
* Use this action to add CSS + JavaScript to assist your render_field_options() action.
*/
/*function field_group_admin_enqueue_scripts() {
}*/
/**
* This action is called in the admin_head action on the edit screen where your field is edited.
* Use this action to add CSS and JavaScript to assist your render_field_options() action.
*/
/*function field_group_admin_head() {
}*/
/**
* This filter is applied to the $value after it is loaded from the db
*
* @param $value (mixed) the value found in the database
* @param $post_id (mixed) the $post_id from which the value was loaded
* @param $field (array) the field array holding all the field options
* @return $value
*/
/*function load_value( $value, $post_id, $field ) {
return $value;
}*/
/**
* This filter is appied to the $value after it is loaded from the db and before it is returned to the template
*
* @param $value (mixed) the value which was loaded from the database
* @param $post_id (mixed) the $post_id from which the value was loaded
* @param $field (array) the field array holding all the field options
*
* @return $value (mixed) the modified value
*/
/*function format_value( $value, $post_id, $field ) {
// bail early if no value
if( empty($value) ) {
return $value;
}
// apply setting
if( $field['font_size'] > 12 ) {
// format the value
// $value = 'something';
}
// return
return $value;
}*/
/**
* This action is fired after a value has been deleted from the db.
* Please note that saving a blank value is treated as an update, not a delete
*
* @param $post_id (mixed) the $post_id from which the value was deleted
* @param $key (string) the $meta_key which the value was deleted
* @return n/a
*/
/*function delete_value( $post_id, $key ) {
}*/
/**
*
* This filter is applied to the $field after it is loaded from the database
*
* @param $field (array) the field array holding all the field options
* @return $field
*/
/* function load_field( $field ) {
return $field;
}*/
/**
* This filter is applied to the $field before it is saved to the database
*
* @param $field (array) the field array holding all the field options
* @return $field
*/
/*function update_field( $field ) {
return $field;
}*/
/**
* This action is fired after a field is deleted from the database
*
* @param $field (array) the field array holding all the field options
*/
/*
function delete_field( $field ) {
}
*/
}
// initialize
new Zz_acf_field_Leaflet( $this->settings );
}