php 阻止Beaver Builder加载远程Google字体和Font Awesome

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php 阻止Beaver Builder加载远程Google字体和Font Awesome相关的知识,希望对你有一定的参考价值。

<?php // do not copy this line, start with line 3
  
add_action( 'wp_enqueue_scripts', function() {
    global $wp_styles;
    if ( isset( $wp_styles->queue ) ) {
        foreach ( $wp_styles->queue as $key => $handle ) {
            if ( 'font-awesome-5' === $handle ) {
                if ( is_dir( ABSPATH . '/fonts/font-awesome' ) ) {
                    $wp_styles->registered[ $handle ]->src = site_url( 'fonts/font-awesome/web-fonts-with-css/css/fontawesome-all.min.css');
                }
            }
        }
    }
}, 11 );
<?php
//Stop Beaver Builder from loading remote Google fonts
add_action( 'wp_enqueue_scripts', function() {
        global $wp_styles;
        if ( isset( $wp_styles->queue ) ) {
                foreach ( $wp_styles->queue as $key => $handle ) {
                        if ( false !== strpos( $handle, 'fl-builder-google-fonts-' ) ) {
                                  unset( $wp_styles->queue[ $key ] );
                        }
                }
        }
}, 101 );
?>

以上是关于php 阻止Beaver Builder加载远程Google字体和Font Awesome的主要内容,如果未能解决你的问题,请参考以下文章

php Beaver Builder为模块插件添加多个字体 - https://wpbeaches.com/adding-web-fonts-beaver-builder-plugin/

php Nice Beaver Builder短代码

php Beaver Builder禁用内联编辑

php Beaver Builder全局设置过滤器

php 覆盖Beaver Builder的Gallery Lightbox

php 在Beaver Builder中为Selector添加图像大小