| @@ -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_descript_enable_embeds' ); |
| 13 | 17 | } else { |
| 14 | 18 | jetpack_descript_enable_embeds(); |
| @@ -22,10 +26,12 @@ | ||
| 22 | 26 | function jetpack_descript_enable_embeds() { |
| 23 | 27 | // Support their oEmbed Endpoint. |
| 24 | 28 | wp_oembed_add_provider( '#https?://share.descript.com/(?:view|embed)/\w+#i', 'https://api.descript.com/v2/oembed', 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_descript' ); | |
| 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_descript' ); | |
| 33 | + } | |
| 28 | 34 | |
| 29 | 35 | // Actually display the descript Embed. |
| 30 | 36 | add_shortcode( 'descript', 'jetpack_descript_shortcode' ); |
| 31 | 37 | } |