Advertisement
SergeyBiryukov

Untitled

Sep 20th, 2014
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.42 KB | None | 0 0
  1. function encode_backticks_in_esc_url( $cleaned_url, $original_url, $context ) {
  2.     if ( 'display' !== $context ) {
  3.         return $cleaned_url;
  4.     }
  5.  
  6.     $url = str_replace( '`', '`', $original_url );
  7.  
  8.     remove_filter( 'clean_url', __FUNCTION__, 10, 3 );
  9.  
  10.     $cleaned_url = esc_url( $url );
  11.  
  12.     add_filter( 'clean_url', __FUNCTION__, 10, 3 );
  13.  
  14.     return $cleaned_url;
  15. }
  16. add_filter( 'clean_url', 'encode_backticks_in_esc_url', 10, 3 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement