• Resolved Code Muffin

    (@code-muffin)


    The plugin adds two CSS files to every admin page: bootstrap-3.3.4.css and style.css. This disrupts the appearance of other admin pages. It also adds bootstrap-3.3.4.js, which seems to prevent the use of the Screen Options tab.

    To get around this, you can enqueue your admin files only on the 301 Redirects settings page. You can use something like the code below to achieve this:

    From line 43 of 301-redirects.php:

    function load_301_redirect_assets($hook) {
        if ( $hook === 'settings_page_301-redirects' ) {
    		wp_enqueue_style( 'redirect_301_bootstrap_css', plugin_dir_url( __FILE__ ) . 'lib/bootstrap-3.3.4.css', false, '1.0.0' );
    		wp_enqueue_style(  'redirect_301_custom_css', plugin_dir_url( __FILE__ ) . 'style.css', false, '1.0.0' );
    		wp_enqueue_script( 'bootstrap', plugin_dir_url( __FILE__ ) . 'lib/bootstrap-3.3.4.js', array(), '1.0.0', true );
        } else return;
    }

    View on Pastebin
    Reference: Codex – admin_enqueue_scripts

    https://wordpress.org/plugins/301-redirects/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Bootstrap CSS added to all admin pages’ is closed to new replies.