| @@ -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_smartframe_enable_embeds' ); |
| 13 | 17 | } else { |
| 14 | 18 | jetpack_smartframe_enable_embeds(); |
| @@ -22,10 +26,12 @@ | ||
| 22 | 26 | function jetpack_smartframe_enable_embeds() { |
| 23 | 27 | // Support their oEmbed Endpoint. |
| 24 | 28 | wp_oembed_add_provider( '#https?://(.*?)\.smartframe\.(io|net)/.*#i', 'https://oembed.smartframe.io/', true ); |
| 25 | 29 | |
| 26 | - // Allow script to be filtered to short code (so direct copy+paste can be done). | |
| 27 | - add_filter( 'pre_kses', 'jetpack_shortcodereverse_smartframe' ); | |
| 30 | + if ( jetpack_shortcodes_should_hook_pre_kses() ) { | |
| 31 | + // Allow script to be filtered to short code (so direct copy+paste can be done). | |
| 32 | + add_filter( 'pre_kses', 'jetpack_shortcodereverse_smartframe' ); | |
| 33 | + } | |
| 28 | 34 | |
| 29 | 35 | // Actually display the smartframe Embed. |
| 30 | 36 | add_shortcode( 'smartframe', 'jetpack_smartframe_shortcode' ); |
| 31 | 37 | } |