If your class is called statically you need to use get_called_class()
like this:
add_action('wp_enqueue_scripts', array( get_called_class(), 'set_bootstrap' ) );
since $this
is not available. This also works if the class is extended.
Related Posts:
- Why is my css and js not enqueued until footer?
- How do I dequeue js/css at the last possible moment?
- How to enqueue additional scripts and styles after loading another post into the DOM?
- How do I enqueue a script to run inside the Gutenberg editor?
- enqueuing React script and hooking its target div fails to load script
- use add_action(‘wp_head’) in a widget
- How to load script-related styles automatically?
- Deregister scripts on unnecessary pages using remove_action
- WP CLI Get all Enqueued Scripts and Styles
- Scripts not loading when using the wp_enqueue_scripts action
- Is this the correct way to enqueue style sheets from parent theme and then from child theme in wordpress?
- Where to place add_action when enqueueing?
- Dequeue styles with query doesn’t work
- Font Awesome not loaded on first page of website only – divi theme
- remove_action or remove_filter with external classes?
- How do I Enqueue styles/scripts on Certain /wp-admin Pages?
- add_action reference a class
- Where is the right place to register/enqueue scripts & styles
- Conditionally Loading JavaScript/CSS for Shortcodes
- How do I dequeue a parent theme’s CSS file?
- Why does save_post action fire when creating a new post?
- Check if a script/style was enqueued/registered
- wp enqueue style on specific page templates
- How to enqueue scripts on custom post add/edit pages?
- How to load css in the footer [duplicate]
- How can I get a list of all enqueued scripts and styles?
- Remove parent theme action in child
- Load CSS/Javascript in frontend conditionally if block is used
- Prevent Version URL Parameter (?ver=X.X.X) on Enqueued Styles & Scripts
- How to know what priority to use with add_action()?
- How to load Widget javascript + css files only if used?
- How to load scripts/styles specific for a page
- How to do_action and get a return value?
- How can I de-register ALL styles all at once? And same with Javascript?
- How to add stylesheets only to pages with specific shortcode?
- Remove an action from an external Class
- Difference between do_action_ref_array() and do_action()
- Conditional wp_enqueue_script on a page
- Can my “add_action” function know the name of the hook calling it?
- Enqueue custom font file with rel=”preload”
- How do I force wp_enqueue_scripts to load at the END of ?
- Why is there both a save_post and wp_insert_post action?
- Does the event ‘wp_version_check’ even exist? What is it doing?
- When is admin_init Action ran?
- Load js/css files only on specific admin UI pages
- Can an action callback prevent the parent from continuing execution?
- remove_action in a theme
- add_action ‘manage_posts_custom_column’ in a class [closed]
- Get list of scripts / styles and show file which enqueued them
- How can I find out what functions are assigned to actions?
- Unable to prevent function using save_post firing twice
- Difference between do_action(‘admin_enqueue_scripts’, $hook_suffix) and do_action(“admin_print_styles-$hook_suffix”) syntax
- Cron jobs in a class
- Add something to beginning of the content
- Why I can’t add a CSS style in this WordPress theme?
- Disable WooCommerce action
- Removing specific style from wp_head
- How to dequeue / deregister any theme styles and scripts
- When can you get current page ID and initialize hooks right after?
- How can I remove the WP menu from the admin bar?
- The difference between calling wp_enqueue_scripts to load scripts and styles in custom theme
- Notice that the wp_enqueue_style is not being called correctly!
- When and Where to use wp_insert_post()
- Correct place to register and enqueue scripts
- Why, Where, and When to use reference pointers in filters/hooks?
- Hyphens vs. periods in the script slug in wp_register_script?
- How can I dequeue a Plugin Stylesheet?
- Use wp_enqueue_scripts, not wp_print_styles?
- Get the list of enqueued/registered scripts for a specific post?
- Add `datetimepicker` to form
- add_action customize_register not working
- What can I hook into after_setup_theme?
- Passing arguments into ‘init’ function
- Add a Custom Field in Comment Box AFTER text area BUT BEFORE Send button
- Trying to load different syles for 404.php page
- How to use conditional add_action for WordPress
- Using wp_insert_post and post_update_meta but need to fire save_post afterward
- What determines the order of enqueued styles?
- WP Schedule Event – Every Day When First Visitor Comes
- $wp_styles->registered not giving ALL the styles?
- Get info (url) from already enqueued styles
- Dynamically Load Styles and Scripts from Theme Functions.php
- wp_logout action not working
- How to combine multiple CSS files and concatenate JavaScripts if WordPress recommends enqueuing them?
- How to use wp_enqueue_style() and wp_enqueue_script() only when needed?
- Preload key requests using wp_enqueue
- How to remove an action that is added inside a class
- How do I load custom scripts and styles for a page?
- Remove a script from a template file using wp_dequeue_script
- Having an add_action( ‘user_new_form’,) [closed]
- Remove specific CSS and JS from the head
- Using auth_redirect returns cannot modify header information
- When is it too late to call the action wp_enqueue_scripts?
- add action which returns modified value
- What would cause the ‘wp’ action to fire twice per page (but only once per post) in Firefox only?
- Problem:Save Several Duplicate posts in The Database and then Error nesting level of ‘100’ reached
- How to remove an action added by a child theme of Genesis
- I don’t understand why I need a lower priority to remove an action with a higher priority to make it work
- Dequeue Scripts and Style for Mobile not working?
- WordPress admin WP_table_list show incorrectly