summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jetpack/modules/publicize/enhanced-open-graph.php')
-rw-r--r--plugins/jetpack/modules/publicize/enhanced-open-graph.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/plugins/jetpack/modules/publicize/enhanced-open-graph.php b/plugins/jetpack/modules/publicize/enhanced-open-graph.php
index ba60b821..e50082ff 100644
--- a/plugins/jetpack/modules/publicize/enhanced-open-graph.php
+++ b/plugins/jetpack/modules/publicize/enhanced-open-graph.php
@@ -16,6 +16,11 @@ function enhanced_og_image( $tags ) {
global $post;
+ // Bail if we do not have info about the post.
+ if ( ! $post instanceof WP_Post ) {
+ return $tags;
+ }
+
// Always favor featured images.
if ( enhanced_og_has_featured_image( $post->ID ) )
return $tags;
@@ -41,6 +46,11 @@ function enhanced_og_gallery( $tags ) {
global $post;
+ // Bail if we do not have info about the post.
+ if ( ! $post instanceof WP_Post ) {
+ return $tags;
+ }
+
// Always favor featured images.
if ( enhanced_og_has_featured_image( $post->ID ) )
return $tags;
@@ -75,6 +85,11 @@ function enhanced_og_video( $tags ) {
global $post;
+ // Bail if we do not have info about the post.
+ if ( ! $post instanceof WP_Post ) {
+ return $tags;
+ }
+
// Always favor featured images.
if ( enhanced_og_has_featured_image( $post->ID ) )
return $tags;