When to use add_action(‘init’) vs add_action(‘wp_enqueue_scripts’)
A lot of plugin developers don’t do things the right way. The right way is to hook on to wp_enqueue_scripts like you’re trying to do. However, here’s the order of the hooks run in a typical request: muplugins_loaded registered_taxonomy registered_post_type plugins_loaded sanitize_comment_cookies setup_theme load_textdomain after_setup_theme auth_cookie_malformed auth_cookie_valid set_current_user init widgets_init register_sidebar wp_register_sidebar_widget wp_default_scripts wp_default_stypes admin_bar_init … Read more