• Resolved Anonymous User 13711045

    (@anonymized-13711045)


    I’ve got the option enabled to disable Gutenberg and “Also disable frontend block styles / CSS files for the selected post types.”. However, the “wp-block-library-css” stylesheet is still being loaded. Would be good for it to be removed if this option is enabled.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Bowo

    (@qriouslad)

    Which theme / page builder are you using?

    Thread Starter Anonymous User 13711045

    (@anonymized-13711045)

    Bricks. I found that adding “wp_deregister_style( ‘wp-block-library’ )” in the “wp_enqueue_scripts” action removed it. Not sure if something changed, but that worked.

    Thread Starter Anonymous User 13711045

    (@anonymized-13711045)

    So I looked into this some more, and it looks like if you can just add “wp_deregister_style(‘wp-block-library’)” to “disable_gutenberg_for_post_types_frontend” function within “Disable_Gutenberg” class and that would work. Also, I was looking in that class and I think you have a typo in there. The actual function is plural.

    https://share.cleanshot.com/qhm4bq0C

    Additionally, I’d like to remove the global styles inline CSS if possible. I found you have to do it this way.

    function remove_global_styles_inline_css() {
    remove_action('wp_enqueue_scripts', 'wp_enqueue_global_styles');
    }
    add_action('init', 'remove_global_styles_inline_css');

    • This reply was modified 1 year, 9 months ago by Anonymous User 13711045.
    Plugin Author Bowo

    (@qriouslad)

    @thekendog thanks for the more detailed follow up as well as the code. When I tried plugging your code, it still doesn’t work. Then I realized that the $post variable sometimes return a null. When I change how that variable is defined, both ‘wp-block-library’ and the inlined ‘global-styles-inline-css’ are both removed properly. This fix will be included in the next release (next Monday). Please test when you see it.

    One other thing… if you find ASE useful for your work / site(s), please consider leaving a quick, 5-star review at https://ww.wp.xz.cn/plugins/admin-site-enhancements/#reviews, which will also help others find ASE as they search for new plugins to install. Thanks.

    Plugin Author Bowo

    (@qriouslad)

    p.s. the typo in the function name will also be fixed. Good catch! Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Dequeue wp-block-library-css’ is closed to new replies.