wp_enqueue_script seperately for each shortcode
You’re pretty close! What you can do is to register all of the scripts via the wp_enqueue_scripts hook normally and then just enqueue them in the shortcode callback. This is telling WordPress about the scripts and then allowing you to only enqueue them as needed: add_action( ‘wp_enqueue_scripts’ ‘register_all_my_scripts’ ); function register_all_my_scripts() { wp_register_script( ‘per-pas-belanja-online’, plugins_url(‘js/per-pas-belanja-online.js’, … Read more