Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load bootstrap assets only on WP Hardening admin pages #23

Open
anandakrishna opened this issue Feb 7, 2021 · 3 comments
Open

Load bootstrap assets only on WP Hardening admin pages #23

anandakrishna opened this issue Feb 7, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@anandakrishna
Copy link
Member

Describe the bug

Currently the bootstrap assets (/wp-content/plugins/wp-security-hardening/modules/inc/assets/css/tw-bs4.css) are loaded on front-end pages too where it is not required.

Expected behavior

Load the resources only for the WP Hardening pages in the WordPress admin area.

@anandakrishna anandakrishna added the bug Something isn't working label Feb 7, 2021
@MashinaMashina
Copy link

I confirm. Loads the page once more

@MashinaMashina
Copy link

We can use this:

add_filter('wpsupercache_buffer', 'filter_function_name_5711');
function filter_function_name_5711( $buffer ){
    $buffer = preg_replace("#<link rel='stylesheet' id='whp[0-9]+?tw-bs4.css-css'  href='.+?/wp-security-hardening/modules/inc/assets/css/tw-bs4.css' type='text/css' media='all' />#", '', $buffer);

    return $buffer;
}

Filter wpsupercache_buffer not working on authorized users, but work on not authorized

@luukvr
Copy link

luukvr commented Sep 20, 2022

#51

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants