Created
August 19, 2025 15:22
-
-
Save Pross/f6f4eb355c850acce5b75bcca618e3db to your computer and use it in GitHub Desktop.
Force WP to encode emoji as HTML entities rather than Unicode for ancient or misconfigured db servers that are not mb4 compatible
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Force WP to encode emoji as HTML entities rather than Unicode for | |
| * ancient or misconfigured db servers that are not mb4 compatible | |
| */ | |
| add_filter( 'fl_builder_before_update_layout_data', function( $data, $status, $post_id ) { | |
| foreach ( $data as $node => $node_data ) { | |
| if ( 'module' === $node_data->type && 'rich-text' === $node_data->settings->type ) { | |
| $data[ $node ]->settings->text = wp_encode_emoji( $data[ $node ]->settings->text ); | |
| } | |
| } | |
| return $data; | |
| }, 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment