Skip to content

Commit 0d95fb0

Browse files
authored
Create README.md
1 parent f7a9889 commit 0d95fb0

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
## ACF Escaping Debug Plugin
2+
3+
In ACF 6.2.5, the plugin began warning users whenever it detected the value being output was not correctly escaped when using the ACF shortcode, `the_field` or `the_sub_field`
4+
5+
In ACF 6.2.7 due for release in February 2024, ACF will automatically begin escaping the value when `the_field` or `the_sub_field` is used.
6+
7+
ACF will show a warning notice in WordPress admin for this detection, but for performance reasons this notice is limited to the name of the field, it's selector used to output the value, and the function called.
8+
9+
This plugin extends that default logging to output a more detailed version whenever it is detected. The output is sent to the PHP error log via `error_log`.
10+
11+
This plugin should not be used on production, as it has potential to generate a log of error log messages.
12+
13+
### Example Output:
14+
15+
```
16+
[18-Jan-2024 15:36:49 UTC] ***ACF HTML Escaping Debug***
17+
HTML modification detected the value of wysiwyg on post ID 140 via the_sub_field
18+
Raw Value: '<p><script>console.log("Repeater Row 3");</script></p>
19+
'
20+
Escaped Value: '<p>console.log(&#8220;Repeater Row 3&#8221;);</p>
21+
'
22+
Template: /Users/liam/Code/local-wp/site.local/wp-content/themes/twentytwentyone/page.php
23+
```

0 commit comments

Comments
 (0)