| @@ -31,8 +31,13 @@ | ||
| 31 | 31 | if ( ! $post instanceof WP_Post ) { |
| 32 | 32 | return $tags; |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | + // A gated body's embedded media is withheld along with the body. | |
| 36 | + if ( \Automattic\Jetpack\SEO\Content_Gate::is_gated( $post ) ) { | |
| 37 | + return $tags; | |
| 38 | + } | |
| 39 | + | |
| 35 | 40 | // Always favor featured images. |
| 36 | 41 | if ( enhanced_og_has_featured_image( $post->ID ) ) { |
| 37 | 42 | return $tags; |
| 38 | 43 | } |
| @@ -73,8 +78,13 @@ | ||
| 73 | 78 | if ( ! $post instanceof WP_Post ) { |
| 74 | 79 | return $tags; |
| 75 | 80 | } |
| 76 | 81 | |
| 82 | + // A gated body's embedded media is withheld along with the body. | |
| 83 | + if ( \Automattic\Jetpack\SEO\Content_Gate::is_gated( $post ) ) { | |
| 84 | + return $tags; | |
| 85 | + } | |
| 86 | + | |
| 77 | 87 | // Always favor featured images. |
| 78 | 88 | if ( enhanced_og_has_featured_image( $post->ID ) ) { |
| 79 | 89 | return $tags; |
| 80 | 90 | } |
| @@ -124,8 +134,13 @@ | ||
| 124 | 134 | global $post; |
| 125 | 135 | |
| 126 | 136 | // Bail if we do not have info about the post. |
| 127 | 137 | if ( ! $post instanceof WP_Post ) { |
| 138 | + return $tags; | |
| 139 | + } | |
| 140 | + | |
| 141 | + // A gated body's embedded media is withheld along with the body. | |
| 142 | + if ( \Automattic\Jetpack\SEO\Content_Gate::is_gated( $post ) ) { | |
| 128 | 143 | return $tags; |
| 129 | 144 | } |
| 130 | 145 | |
| 131 | 146 | // Always favor featured images. |