Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

ACF js filter `esc_html_dompurify_config` not working

未关闭
#968 1 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
javascript, php
领域
frontend

调研方向

在使用 ACF 6.4.3 的 WordPress Editor 中重现该问题,使用带有组标签的区块或字段,以及报告中所示的 esc_html_dompurify_config 回调。检查 acf.add_filter 或 acf.addFilter 是否注册了该过滤器,并在回调被调用且能够影响 DOMPurify 配置时验证是否完成。

由索引模型根据 Issue 内容生成。

描述

Describe the bug
Trying to use the new filter introduced in 6.4.3 esc_html_dompurify_config to not escape some html tags in the group label.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Editor (with a block or field with group label)
  2. Monitor the console.
  3. No console for the filter.

Expected behavior
acf filter 'esc_html_dompurify_config' to function.

Code
Tried with:

import domReady from '@wordpress/dom-ready';

domReady(() => {
 if (typeof acf !== 'undefined') {
    acf.add_filter(
      'esc_html_dompurify_config',
      function (config) {
        console.log('Sis');
        return config;
      }
    );
  }
});

and with:

acf.addFilter('esc_html_dompurify_config', function(config) {
 console.log('Bro');
  return config;
});

[!IMPORTANT]
The script is enqueued and other filters work.

Version Information:

  • WordPress 6.8.2
  • PHP Version 8.2
  • ACF Version 6.4.3
  • Browser doesn't matter

Any help will be apreciated 👉👈

主要语言
PHP
星标
946
派生
197
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

AdvancedCustomFields/acf 的其他 Issue

查看 AdvancedCustomFields/acf 的全部 Issue

相似的 Issue

更多 PHP Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。