How Can I Pass the Shortcode’s $atts Variable to the Plugin’s Javascript Function
You need to have some initial (maybe global) js var markers_array = [];. Then use an ajax callback function to bump your markers into that array. Register your scripts // Define $root_url = plugin_dir_path(); // Example path $ajax_nonce=”your_nonce”; $ajax_nonce_val=”your_val”; // Ajax wp_register_script( ‘json2’, false, false, false, true ); wp_enqueue_script( ‘json2’ ); wp_enqueue_script( ‘ajax-script’ ,”{$root_url}js/ajax_json.js” // … Read more