I am facing difficulty applying Bootstrap to my custom dashboard widget.
function admin_theme_style() {
if( is_admin() ) {
wp_enqueue_script('bootstrap-script', plugin_dir_url($this->_FILE_) . 'includes/js/bootstrap.min.js');
wp_enqueue_script('jquery-ui-core', false, array('jquery'));
wp_enqueue_script('google-platform', '//apis.google.com/js/platform.js', array('jquery'));
wp_enqueue_style('webinar', plugin_dir_url($this->_FILE_) . 'includes/css/webinar.css');
wp_enqueue_style('bootstrap', plugin_dir_url($this->_FILE_) . 'includes/css/bootstrap.css');
}
}
add_action('admin_enqueue_scripts', array($this,'admin_theme_style');
For the plugin, scripts and CSS gets loaded correctly.
$this->_FILE_
syntax. Also, I'm not sure Bootstrap's JavaScript should be enqueued before it's CSS.