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:
- How to enable suggested edits?
- How to change a user’s password programatically
- Cannot install plugins even though www-data has write permissions
- How to delete custom taxonomy terms in plugin’s uninstall.php?
- To Disable WordPress Rest API or Not To Disable?
- how to include other plugins css files in a shortcode?
- Email Notifications of new posts to users – suggestions [closed]
- How to call a plugin function from front end form
- Get URL of a specific file
- Building a plugin that doesn’t break when deactivated
- translation does not work with text_domain
- Get subcategories with JSON API plugin
- WooCommerce plugin appearance and look [closed]
- adding a text message beside the comment submit button
- Overide a function that is inside a plugin
- If I delete plugins via FTP are settings kept in DB?
- Many plugins making WordPress run slow by design?
- Remove caching from wp_remote_get calls from custom plugin
- Detect the activated theme from plugin code
- Transient unique names
- Hook into and send mail using WP Mail SMTP type plugin from HTML static front page?
- Missing Argument
- load_plugin_textdomain error
- Woocommerce pagination problem
- Can’t delete Draft Post [closed]
- Looking for a way that will collect visitors emails before letting them view the blog posts [closed]
- Why am I getting ( WooCommerce Services could not be installed (Could not create directory.). ) error and how to solve it ?
- How can i get the post’s full html source by its ID?
- Redux Framework: Page freezes on typing in Editor
- How can I inject options into an select tag inside the widget form?
- WordPress user account activation
- Init plugin again after ajax call finish
- Import sql data from a large file when installing plugin
- WooCommerce : Direct Checkout Page [closed]
- Is there a rule for wordpress plugins developers to not do any database changes upon update?
- Can i add custom code in Source, Header from function.php?
- Problem with isset and $_POST
- serverSideRender does not render “preview” html inside Gutenberg block
- add seperate suffix for low price and high price in woocommerce
- URL rewrite with external JSON query
- How to delete a theme using AJAX
- Adding a responsive grid onto a page (without using a Bootstrap theme) [closed]
- Class or function wrapper for plugin code
- Licensing a Plugin [closed]
- Add a function call after content automatically?
- Var_dump ACF “API”
- Equivalent of admin.php for public pages
- Detect plugin/theme installation (via upload)
- Engadget Like Featured Breaking Plugin
- sliding/fading header plugin or approach suggestion
- Google Analytics event tracking code being stripped out of links in Author box – WordPress site
- All In One SEO Plugin – Category INDEX
- Import Recent Posts Only and Ignore old ones if exist
- Security of a WordPress Plugin
- @wordpress/scripts advanced usage
- wp_post not working, keeps redirecting to posts page
- How to display ACF coustom field from category on author.php
- How to add Mobile field in Registration form using Theme my login Plugin
- Replace only the first CSS class
- prevent anonymous access to WordPress site (non-admin site)
- make p tag collapsed after 3 rows
- WPBakery Page Builder Shortcode Showing On Front Page For Post
- Student access credentials
- General Term for this form Field
- Scroll to ID broken in main menu
- Comment restrictions Wodpress
- Generate and send ICS file through WordPress
- Gutenberg editor in WordPress 5.0.3 /wp-json/wp/v2/pages/4713/autosaves?_locale=user 500 (Internal Server Error)
- WP Plugin permissions – create new files
- How to capture customer’s credit card details via PayPal on my checkout page?
- Add code to page template on page built with Visual Composer
- Is it possible to create duplicate post on other site (either push, on publish, or pull, periodically)?
- .htaccess file doesn’t work, with hundred tries
- using wordpress login details for other website / application / forum?
- plugin translation is not working
- ACF Repeater Field Question [closed]
- A more elegant way to handle notices/warnings
- To set a post is new/old in vertical scrolling
- ACF repeater field
- How to remove ‘View Details’ page & updates from third-party plugin?
- Which wordpress plugin increases the size of tag as per more number of posts on it?
- appointment plugin doesn’t display all appointments
- First argument is expected to be a valid callback for cp_admin_init and _canonical_charset
- Get the url of attachments from the post?
- Doing action based on input from options menu
- Images not showing and plugins not installing on wordpress server move
- WordPress User Frontend Editing Custom Fields
- W3 Total Cache and IIS7 not doing much [closed]
- Mystery URL http://#/ Listed in XML Sitemap Created by WordPress SEO by Yoast Plugin
- “The Events Calendar” Issues in WP 3.2
- What are the downsides of using bootstrap in plugin development?
- How ACF Advanced Custom Field works with Woocommerce Single Product [closed]
- Function mb_strlen Fail [closed]
- How can I be a plugin developer? [closed]
- Images get uploaded itself from the computer
- getPost() method and Pagination
- Can’t save formdata in DB
- Event Made Easy – Block registration to two or more events that have the same category
- Allow manage_options capability for specific user only for specific plugin?
- I want to allow certain file types on dokan upload files