Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Enqueues a stylesheet handle or an array of stylesheet handles.
- function mytheme_enqueueStyle($handles) {
- if (is_array($handles)) {
- add_action("wp_enqueue_scripts", function() {
- foreach ($handles as $handle) {
- wp_enqueue_style($handle);
- }
- });
- } else if (is_string($handles)) {
- add_action("wp_enqueue_scripts", function() {
- wp_enqueue_style($handles);
- });
- } else {
- wp_die("Unsupported parameter type.");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement