-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Tangible Blocks and L&L, which have dynamic frontend features that require JS & CSS, like a gallery or slider. I have a feeling some are only enqueued on the site frontend but not on admin side. And definitely not in the login page.
For blocks and templates to support all contexts, it will be good to create a "universal enqueue" function for all those dynamic features to use.
Similar to:
How the Fields module enqueues the WP media uploader.
if (is_admin()) {
// Admin
// Before document head
$action = 'admin_enqueue_scripts';
if (doing_action($action) || did_action($action)) {
$action = 'admin_footer'; // During and after
}
} elseif (is_login()) {
// Login
// Before document head
$action = 'login_enqueue_scripts';
if (doing_action($action) || did_action($action)) {
$action = 'login_footer'; // During and after
}
} else {
// Site frontend
// Before document head
$action = 'wp_enqueue_scripts';
if (doing_action($action) || did_action($action)) {
$action = 'wp_footer'; // During and after
}
}Metadata
Metadata
Assignees
Labels
No labels