From 8f4824b7b753e0b999009cfadd6846e4379c637f Mon Sep 17 00:00:00 2001 From: MD Shuvo <66669067+shuvo7670@users.noreply.github.com> Date: Thu, 11 Jul 2024 10:51:57 +0600 Subject: [PATCH] added refresh cache condition for facebook --- includes/Social/Facebook.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/includes/Social/Facebook.php b/includes/Social/Facebook.php index c87462ad..e676aacd 100644 --- a/includes/Social/Facebook.php +++ b/includes/Social/Facebook.php @@ -243,7 +243,10 @@ public function remote_post($app_id, $app_secret, $app_access_token, $type, $ID, // Refresh Facebook cache before sharing $post_url = get_permalink($post_id); - $this->refresh_facebook_cache($app_id, $app_secret, $post_url); + + if( ( get_post_meta( $post_id, $count_meta_key, true ) ) > 0 ) { + $this->refresh_facebook_cache($app_id, $app_secret, $post_url); + } // group api if ($type === 'group') {