【问题标题】:How to remove front svg in wordpress 5.9 version如何在 wordpress 5.9 版本中删除前端 svg
【发布时间】:2022-11-02 19:40:10
【问题描述】:

如何在 wordpress 5.9 版本中删除前端 svg

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 0 0" width="0" height="0" focusable="false" role="none" style="visibility: hidden; position: absolute; left: -9999px; overflow: hidden;"><defs><filter id="wp-duotone-dark-grayscale"><feColorMatrix color-interpolation-filters="sRGB" type="matrix" values=" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 "></feColorMatrix><feComponentTransfer color-interpolation-filters="sRGB"><feFuncR type="table" tableValues="0 0.49803921568627"></feFuncR><feFuncG type="table" tableValues="0 0.49803921568627"></feFuncG><feFuncB type="table" tableValues="0 0.49803921568627"></feFuncB><feFuncA type="table" tableValues="1 1"></feFuncA></feComponentTransfer><feComposite in2="SourceGraphic" operator="in"></feComposite></filter></defs></svg>

【问题讨论】:

    标签: wordpress


    【解决方案1】:

    我找到了一种方法,它有效! https://github.com/WordPress/gutenberg/issues/36834#issuecomment-1048923664

    remove_action( 'wp_enqueue_scripts', 'wp_enqueue_global_styles' );
    remove_action( 'wp_body_open', 'wp_global_styles_render_svg_filters' );
    

    【讨论】:

    • 正如目前所写,您的答案尚不清楚。请edit 添加其他详细信息,以帮助其他人了解这如何解决所提出的问题。你可以找到更多关于如何写好答案的信息in the help center
    • remove_action( 'wp_body_open', 'wp_global_styles_render_svg_filters' ); 这对我有用。
    【解决方案2】:

    5.9 在 &lt;head&gt; 中添加了一些额外的全局样式。如果您不想通过添加此代码 sn-p 来禁用它们。

    add_action(wp_enqueue_scripts','remove_my_global_styles');
    function remove_my_global_styles() {wp_dequeue_style('global-styles');
    }
    

    【讨论】:

      【解决方案3】:

      首先加载的是什么?

      【讨论】:

      猜你喜欢
      • 2010-11-12
      • 2011-02-10
      • 2023-02-03
      • 2019-07-04
      • 1970-01-01
      • 2015-09-20
      • 2019-10-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多