you can enqueue scripts (and styles) in the shortcode like that :
add_shortcode("kross", function ($atts, $content, $tag) {
$atts = shortcode_atts([
'user-id' => '',
'editor-id' => '',
], $atts);
wp_enqueue_script(
"kross-js"
, "https://{$atts["editor-id"]}kross1.com/widget/6.js?lang=it&be_id={$atts["user-id"]}"
);
$result = "kross result";
return $result;
});
Related Posts:
- Can I leave off plugin textdomain for terms used in core?
- How to tell if a plugin is multisite compatible?
- Changing title of a page dynamically from within a plugin
- How do you allow plugins to be updated using the GUI without breaking your subversion repository?
- Correct way to serialize the data of options table?
- How to force WordPress to temporarily switch locale (using qTranslate)? [closed]
- category_name not working (not showing up in sql query debug)
- GPL and plugins
- add_rewrite_rule, plugin activation and plugin deactivation
- Custom admin column disappearing when using Quick Edit [duplicate]
- Create page when plugin is activated
- wp_insert_user – how to send verification email before logging in
- Custom plugin settings: clicking “save changes” does not display success message
- WordPress Hook that will run when media file deleted
- Prevent multisite sites from using a plugin
- Plugins won’t auto-update on IIS
- Make plugin uninstalable on older versions of WordPress
- Qtranslate displays empty categories with get_categories()
- How can I translate the name of my Plugin for other languages?
- Article source link for posts
- WordPress media upload limit?
- Get the current taxonomy product category title in woocommerce
- Remote plugin activation hook
- How to make a plugin auto-add item to nav menu
- Custom Post Type causes Page Not Found
- How can I filter blog name?
- Logs to check when the plugin was first installed for the first time
- How to get custom field image url of specific size
- Getting “Fatal error: Call to undefined function wp_cache_get() in option.php” after updating a cache plugin [closed]
- Can a plugin add to header/footer/body content?
- Detect if a plugin was included in a certain page
- How can I make the “Preview Post” button save and preview in the same window?
- WordPress Custom Application form
- Facebook Like Button On Individual Comments
- how to load tinymce external plugin
- Organising the plugins folder in wordpress
- Cannot run the code after I activate the plugin
- Plugin could not be activated because it triggered a fatal error. (No Error??)
- Adding a jquery script to plugin contact form 7
- Keep user’s privileges on accessing contents in JSON response
- Displaying admin notice dynamically
- Weird problems after recovery from security breach
- How to retrieve custom meta term of category taxonomy from WP Rest API?
- Get total number of comment of the posts written by an author
- How to Dequeue All WordPress Assets
- Problem with wp_enqueue_scripts in plugin
- Best Practice: Remove data on deactivation or uninstall?
- WooCommerce & Caching [closed]
- Show Heirachy of categories in WP Download Monitor
- How to replace or display the special characters from JSON API plugin [closed]
- Output HTML only on individual post view
- Why plugin ajax response is -1?
- printf – problem to understand code
- Pass info from functions.php to plugin
- google conversion code
- add_query_arg not working
- Elementor\Scheme_Typography’ not found [closed]
- How do I add a custom sub menu menu under Woo-commerce marketing?
- myCRED custom hook preferences doesn’t update creds and log
- Limit Number of Taxonomy Terms (Images) Displayed
- Widget for adding HTML markup to a page
- WordPress filter that hook after each action/filter hook
- When to use action hooks and plugins
- Uncode theme content block header ignoring saved changes/not updating?
- Unique 4 digit number
- One of my plugins broke when I tried to update it, how do I safely uninstall it?
- How to create custom tables in WordPress using my own plugin?
- How can I create a custom shortcode that will return a custom post type by ID?
- importing plugin w/ settings from one WP installation to another
- After plugin options changed hook
- How to make a slideshow shortcode based on the WordPress gallery shortcode? [closed]
- How to enable qTranslate languages tabs in custom plugin page
- WooCommerce Checkout Error [closed]
- How can I change a plugin’s URL?
- Plugin: Google Analytics for Dashboard error – Timestamp is too far from current time
- Linking an image to open a youtube video in lightbox/fancybox in wordpress
- How to modify WCMP Rest API response?
- Making a Template for a CPT created by a plugin
- Woocommerce dependent plugin
- Get sent emails without email logs
- External CSS in WordPress Plugin [closed]
- PHP basics help in WP context – remove a class/function?
- User Session and Stored Cookies not get removed
- User registration
- Plugin dependencies: show notice like theme plugins dependencies
- get 404 when accessing wp-admin/plugin-install.php
- Pre booking doesn’t work with custom bootstrap modul in woocommerce [closed]
- WordPress change Language not working
- What will happen if i deactivate my visual composer plug in? [closed]
- Custom Pages for Woocommerce Product-Category Pages
- Woocommerce Minimum Price for a Composite Product to add in cart
- What is most efficient way to migrate wordpress website?
- Bulk updates to post_content
- Advanced AJAX Page Loader ignores other JS code
- update_user_meta() misfires sometimes
- Show meta box only when post is being published first time
- Migrating problem from Joomla to WP
- WordPress 3.8.3. custom theme – sliders won’t load js/css files
- wp_enqueue_script registers script but does not create html tag
- Multiple domains issue