I’m new to wordpress plugin development so I’m a beginner. I am developing a plugin. I want to use bootstrap 5 for plugin.
I have added a code like this for bootstrap 5 CDN.
public function enqueue_styles() {
/**
* This function is provided for demonstration purposes only.
*
* An instance of this class should be passed to the run() function
* defined in Info_Master_Bk_Loader as all of the hooks are defined
* in that particular class.
*
* The Info_Master_Bk_Loader will then create the relationship
* between the defined hooks and the functions defined in this
* class.
*/
wp_enqueue_style($this->plugin_name.'-bst-cdn', 'https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css', array(), $this->version);
}
But when I added this, it affected the entire wordpress admin panel. How do I make it only affect my plugin?
2
Answers
Use a hook, for admin side you can use: "admin_enqueue_scripts"
Please follow the correct enqueue procedure.
You can use it this way:
Thank you