Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filters on post title, content and excerpt #1712

Open
smarx80 opened this issue Nov 23, 2020 · 1 comment
Open

Filters on post title, content and excerpt #1712

smarx80 opened this issue Nov 23, 2020 · 1 comment

Comments

@smarx80
Copy link

smarx80 commented Nov 23, 2020

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.

@smarx80
Copy link
Author

smarx80 commented Nov 23, 2020

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' );
        }

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant