remove wptexturize from content
-
Hi,
using the plugin I noticed a problem in sending title, content and excerpt of products to Facebook.
In the file include/fbproduct.php it seems that are used directly $post->content , $post->title etc… which is almost fine, but it doesn’t apply all the filters that are needed and that are set by theme and plugins.
In a context where plugins like wpglobus are used for translations, incorrect data are sent, (will be sent also all amount of its placeholders for example, obviously).
I have therefore corrected it using the corresponding functions (get_the_title, get_the_excerpt) and applied the corresponding content filter, removing the wptexturize to avoid problems of incorrect rendering of some characters that are not then reconverted on Facebook.
Here the diff so you can push in next release if you want.
Thanks,
Simone.320,326d319 < if (has_filter('the_content', 'wptexturize')) $texturize=true; < else $texturize=false; < if($texturize) < { < remove_filter( 'the_content', 'wptexturize' ); < remove_filter( 'the_excerpt', 'wptexturize' ); < } 329c322 < apply_filters( 'the_content', get_the_content(null,false,$post) ) --- > $post->post_content 332c325 < get_the_excerpt($post) --- > $post->post_excerpt 335c328 < get_the_title($post) --- > $post->post_title 337,341d329 < if ($texturize) < { < add_filter( 'the_content', 'wptexturize' ); < add_filter( 'the_excerpt', 'wptexturize' ); < }
- The topic ‘remove wptexturize from content’ is closed to new replies.