You are doing the do_action
before the action is add, try moving it:
$name = "link";
add_shortcode($name, 'aa_link_shortcode');
function shorcode_resources($var1) {
global $post;
$shortcode_found = false;
if (has_shortcode($post->post_content, $var1)) {
$shortcode_found = true;
}
if ($shortcode_found) {
wp_enqueue_style('core', ABS_URL . '/shortcode/css/flipbox.css', false);
wp_enqueue_script('my-js', ABS_URL . '/shortcode/js/flipbox(' . $var1 . ').js', false);
}
}
//first we add the action
add_action('wp_enqueue_scripts', 'shorcode_resources', 10, 1);
//then we do the action
do_action('wp_enqueue_scripts', $name);
also remember that wp_enqueue_scripts
its an action that WP will trigger too
Related Posts:
- jQuery does not work
- Scripts not loading when using the wp_enqueue_scripts action
- How to use wp_enqueue_script properly?
- True parameter but jquery register in header and not in the footer with wp_register_script
- remove_action on after_setup_theme not working from child theme
- Remove Actions/Filters added via Anonymous Functions
- How to load scripts/styles specific for a page
- WordPress Enqueue for homepage only, functions.php, wp-framework
- Trying to use add_action and do_action with parameters
- Check if post is being published for the first time, or is an already published post being updated
- How to use the do_action () with parameter
- Perform an action when post is updated/published
- WordPress Theme Update Action?
- Extract image from content and set it as the featured image
- Do WordPress’ cron’s clean up expired transients?
- add_action in a function, is it possible?
- deregister scripts on certain page
- Using a private method as an action callback from within a class
- Refresh page after form action
- How to restrict actions and filters “properly” by conditions
- How to count number of functions attached to an action hook?
- Add action hook conditionally – only when home.php in use
- Enqueue Script with data attributes
- Using add_filter() in Widgets
- How to enqueue every script in a folder automatically?
- How can I tell if I’m on a login page? [duplicate]
- Change meta tags programatically
- Convert hyphen to underscore in permalinks
- Using get_terms for custom taxonomy in functions.php
- Fatal error: Call to undefined function add_action() – an untouched problem
- Most elegant way to enqueue scripts in function.php with foreach loop
- wp_register_script not loading as expected
- How to hook into the quick edit action?
- Problem using is_single() to enqueue script from functions.php
- Reuse variable in hook callback
- Dequeue Scripts and Style for Mobile not working?
- Call to undefined add_action() in theme’s functions.php
- Enqueuing External Javascript functions.php
- How to enqueue JavaScript for specific WordPress pages only?
- Enqueue script o style only if a template part is loaded
- WooCommerce add_action hook results in 500 error
- Enqueuing Script in functions.php vs on the page
- Dequeue script in template isn’t working
- Automatically Add Specified Value to Attachment Metadata upon Upload
- Can’t Update function.php after writing short code
- How to update feed only 2-3 times a week (for Feedburner email)?
- If is multiple page templates
- How would go about if I just want a temporary function?
- How do I get a child theme to load scripts from the parent theme?
- wp_enqueue_script add integrity parameter
- Pass parameters to function through an action
- Accepted arguments value in hook functions
- When using wp_enqueue_script(); in a theme why don’t we use add_action?
- How to select a page within admin?
- How to manage arrays from custom functions stored in functions.php?
- Load JS Script only for custom post types
- How do I pass arguments for multiple functions hooked to a single action?
- Which action hook to use for function?
- Enqueue scripts not working with if is page conditional tag in functions.php
- Custom HTML in specific category single page and its descendant categories
- wp_is_mobile dequeue not working
- Register vendor JS/CSS only on pages that require them?
- Why won’t my scripts load?
- Modify a function without editing template
- Don’t delete a page if it holds users
- How do I add Bootstrap and LESS to my migrated WordPress site?
- Not sure if enqueuing js scripts properly
- Only let plugin add actions to wp_head & wp_footer on single posts
- Register and load scripts
- Which action does wp_update_user triggers?
- How can I get my Script to work on the Login page?
- Trigger a custom function when option are saved in admin area
- Is there an alternative to get_template_directory_uri()?
- enqueue styles for only mobile wp
- how to en-queue jQuery to load before the tag
- Reuse variable in hook callback
- Wait a result before enqueue
- Redirect to another page if the user is logged in when pressing again the login button on menu bar
- Attempt to change jQuery version caused White Screen of Death
- Multiple Loops Meta Data
- Function added using `add_action()` not being called
- Difference b/w Simple function call & do_action call
- jQuery code not working when included in functions.php
- enqueue_script with filemtime javascript not working
- Override the WordPress core function wp_referer_field
- Set Taxonomy based on post status
- Two functions with different arguments and add_actions, but identical code
- add_action template_redirect not working for home page
- I can’t seem to install Font Awesome locally [closed]
- AMP – Change rel=”canonical” from functions.php [closed]
- add_action wp_enqueue_script priority level only works for admins
- Is there a way to prevent a function/method from being called outside a specific hook?
- Why does get_template_directory_uri() not include “www”, only for enqueued stylesheets?
- In jquery use php variable to execute an enqueued jquery file
- Auto-Tweet if Type is ‘Status’ using OAuth
- Missing argument for the function
- Enqueue script on every page except one
- problem loading stylesheets to wp_head dynamically
- Run a jquery script on on a certain template page
- current_user_can comma list vs OR (||) list