• Resolved smarx80

    (@smarx80)


    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' );
    <             }
    
Viewing 2 replies - 1 through 2 (of 2 total)
  • Stuart Duff – a11n

    (@stuartduff)

    Automattic Happiness Engineer

    Hi @smarx80,

    With regards to possible improvements for the FaceBook for WooCommerce plugin, you can contribute those from the plugins official GitHub repository located at this location below.

    https://github.com/facebookincubator/facebook-for-woocommerce/issues

    If you create an issue report with your improvements the development team will investigate these for you. You could also create a pull request and directly contribute the improvements to the plugin yourself to be reviewed by the development team.

    AJ a11n

    (@amandasjackson)

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘remove wptexturize from content’ is closed to new replies.