| @@ -7,8 +7,12 @@ | ||
| 7 | 7 | * |
| 8 | 8 | * @package automattic/jetpack |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 12 | + exit( 0 ); | |
| 13 | +} | |
| 14 | + | |
| 11 | 15 | if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) { |
| 12 | 16 | add_action( 'init', 'jetpack_getty_enable_embeds' ); |
| 13 | 17 | } else { |
| 14 | 18 | jetpack_getty_enable_embeds(); |
| @@ -25,10 +29,12 @@ | ||
| 25 | 29 | // Support their oEmbed Endpoint. |
| 26 | 30 | wp_oembed_add_provider( '#https?://www\.gettyimages\.com/detail/.*#i', 'https://embed.gettyimages.com/oembed/', true ); |
| 27 | 31 | wp_oembed_add_provider( '#https?://(www\.)?gty\.im/.*#i', 'https://embed.gettyimages.com/oembed/', true ); |
| 28 | 32 | |
| 29 | - // Allow iframes to be filtered to short code (so direct copy+paste can be done). | |
| 30 | - add_filter( 'pre_kses', 'wpcom_shortcodereverse_getty' ); | |
| 33 | + if ( jetpack_shortcodes_should_hook_pre_kses() ) { | |
| 34 | + // Allow iframes to be filtered to short code (so direct copy+paste can be done). | |
| 35 | + add_filter( 'pre_kses', 'wpcom_shortcodereverse_getty' ); | |
| 36 | + } | |
| 31 | 37 | |
| 32 | 38 | // Actually display the Getty Embed. |
| 33 | 39 | add_shortcode( 'getty', 'jetpack_getty_shortcode' ); |
| 34 | 40 | } |