I’m writing (rewriting) my plugin to use
wp_enqueue_script('jquery');
wp_enqueue_script('jquery-ui-dialog');
Which is great!
But to use the dialog I need to load a jquery style sheet with wp_enqueue_style, is there a way to load a built-in style, similar to the way you can load the built in scripts (as seen above)? Or do I need to make a call to an external resource?
I’m a little confused by your question, can you not simply use
wp_enqueue_style
, given you mentioned it in the title of the question.The
wp_enqueue_style
function works in the same way as thewp_enqueue_script
counterpart, but as you’d expect, enqueues stylesheets in place of scripts.Here’s a list of the enqueues i was able to find in WordPress core, styles you can load without needing to register them or declare paths to (updated for 6.0 – holy post update batman!).
Beyond using the styles listed above you’ll need to declare a path inside your enqueue as it’s not a registered style, like you would for scripts.
Enqueue only
or..
Register
And call
For use on a single plugin page i’d skip the registration part and make a single enqueue call.
Hope that’s the information you’re looking for. 🙂