Last active
October 31, 2018 20:38
-
-
Save brettshumaker/1efbd9f5bbefe6ca1c369b47b40be722 to your computer and use it in GitHub Desktop.
Fix `wp_link_query` special character encoding
This file contains 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
<?php | |
add_filter( 'wp_link_query', 'trac_44310_wp_link_query', 10, 1 ); | |
function trac_44310_wp_link_query( $results ) { | |
foreach( $results as $index => $result ) { | |
$results[$index]['title'] = trim( esc_html( strip_tags( html_entity_decode( $result['title'] ) ) ) ); | |
} | |
return $results; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment