facebook-for-woocommerce
facebook-for-woocommerce copied to clipboard
Filters on post title, content and excerpt
Hi, our products published on facebook have problems with the titles. To be more specific, we have some plugins active on the site that use post_title hooks to modify titles but your plugin uses $post->post_title, so these filters are bypassed.
I suggest changing the public function get_fb_description() defined in the fbproduct.php file: line 328: replace $post->post_title with get_the_title($ post)
Similarly, it should be corrected in line 322: get_the_content(null,false,$post)
and 325:
get_the_excerpt($post)
Can you push these changes in next release please?
Thanks, Simone.
file fbproduct.php from line 319:
` $post = $this->get_post_data(); if (has_filter('the_content', 'wptexturize')) $texturize=true; else $texturize=false; if($texturize) { remove_filter( 'the_content', 'wptexturize' ); remove_filter( 'the_excerpt', 'wptexturize' ); }
$post_content = WC_Facebookcommerce_Utils::clean_string(
apply_filters( 'the_content', get_the_content(null,false,$post) )
);
$post_excerpt = WC_Facebookcommerce_Utils::clean_string(
get_the_excerpt($post)
);
$post_title = WC_Facebookcommerce_Utils::clean_string(
get_the_title($post)
);
if ($texturize)
{
add_filter( 'the_content', 'wptexturize' );
add_filter( 'the_excerpt', 'wptexturize' );
}
`