diff --git a/web/modules/custom/blog/src/EventSubscriber/PushBlogPostToSocialMedia.php b/web/modules/custom/blog/src/EventSubscriber/PushBlogPostToSocialMedia.php index 358f84d8c..5c3a539f4 100644 --- a/web/modules/custom/blog/src/EventSubscriber/PushBlogPostToSocialMedia.php +++ b/web/modules/custom/blog/src/EventSubscriber/PushBlogPostToSocialMedia.php @@ -53,6 +53,10 @@ final class PushBlogPostToSocialMedia implements EventSubscriberInterface { return; } + if (!$entity->shouldSendToSocialMedia()) { + return; + } + // If this post has already been sent to social media, do not send it again. if ($entity->hasBeenSentToSocialMedia()) { return;