Please load bootstrap only in your own settings in the admin area
-
Hi
Please do not load the bootstrap code in every admin screen. It is conflicting with other plugins loading bootstrap.
change you code to
// Bootstrap file browser wp_register_script( 'aui-custom-file-input', $url = $this->url.'assets/js/bs-custom-file-input.min.js', array('jquery'), $this->select2_version ); wp_add_inline_script( 'aui-custom-file-input', $this->inline_script_file_browser() ); $load_inline = false; if($this->settings[$js_setting]=='core-popper'){ // Bootstrap bundle if ('admin.php' == basename($_SERVER['PHP_SELF']) && isset($_GET['page']) && stripos($_GET['page'], 'userswp') === 0 ) { $url = $this->url.'assets/js/bootstrap.bundle.min.js'; wp_register_script( 'bootstrap-js-bundle', $url, array('select2','jquery'), $this->latest ); wp_enqueue_script( 'bootstrap-js-bundle' ); $script = $this->inline_script(); wp_add_inline_script( 'bootstrap-js-bundle', $script ); } }elseif($this->settings[$js_setting]=='popper'){ if ('admin.php' == basename($_SERVER['PHP_SELF']) && isset($_GET['page']) && stripos($_GET['page'], 'userswp') === 0 ) { $url = $this->url.'assets/js/popper.min.js'; wp_register_script( 'bootstrap-js-popper', $url, array('jquery'), $this->latest ); wp_enqueue_script( 'bootstrap-js-popper' ); $load_inline = true; } }else{ $load_inline = true; }
in the file called ayecode-ui-settings.php to avoid this issue and only load it in your own settings page in the admin area.
Thank you !
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Please load bootstrap only in your own settings in the admin area’ is closed to new replies.