Open paulschreiber opened 8 years ago
Here's a workaround:
foreach ( $fields as $index => $field ) {
if ( 'description' === $field['key'] ) {
$fields[ $index ]['sanitize_function'] = function( $s ) { return html_entity_decode( wp_filter_post_kses( $s ) ); };
}
}```
Could you clarify where you're seeing this please? I'm assuming it's on the guest author edit screen in the "Biographical Info" textarea. Here are the steps I've taken to reproduce:
Aaron is here.
Aaron is here.
as expectedYou missed the the ampersand in step 2. &Aaron is here
.
This results in &Aaron is here
instead of the expected &Aaron is here
.
Ah that may have been a typo.
Here's what I'm typing in:
Then I hit save and see
^ That's actually after saving twice (once to add the .
).
Yup. That's the bug.
This results in
&Aaron is here
instead of the expected&Aaron is here
.
I thought the bug was the double amp
as in that ^ example?
My original example showed the HTML source of a double-encoded ampersand (&
). Your example showed the rendered version (&
). We're seeing the same bug.
The Biographical Info (cap-description) field is double encoded. It generates HTML like this:
In
class-coauthors-guest-authors.php
, inget_guest_author_fields()
, we have this code:By calling
wp_filter_post_kses
instead of the default filter (sanitize_text_field
), we end up with the double encoding.