| @@ -35,9 +35,16 @@ | ||
| 35 | 35 | * |
| 36 | 36 | * @package automattic/jetpack |
| 37 | 37 | */ |
| 38 | 38 | |
| 39 | -add_filter( 'pre_kses', 'googleapps_embed_to_shortcode' ); | |
| 39 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 40 | + exit( 0 ); | |
| 41 | +} | |
| 42 | + | |
| 43 | +if ( jetpack_shortcodes_should_hook_pre_kses() ) { | |
| 44 | + add_filter( 'pre_kses', 'googleapps_embed_to_shortcode' ); | |
| 45 | +} | |
| 46 | + | |
| 40 | 47 | add_shortcode( 'googleapps', 'googleapps_shortcode' ); |
| 41 | 48 | |
| 42 | 49 | /** |
| 43 | 50 | * Reverse iframe embed to shortcode mapping HTML attributes to shortcode attributes. |
| @@ -209,9 +216,9 @@ | ||
| 209 | 216 | return false; |
| 210 | 217 | } |
| 211 | 218 | |
| 212 | 219 | // Calendars. |
| 213 | - if ( ( 'www' === $domain || 'calendar' === $domain ) && 'calendar/' !== substr( $dir, 0, 9 ) ) { | |
| 220 | + if ( ( 'www' === $domain || 'calendar' === $domain ) && ! str_starts_with( $dir, 'calendar/' ) ) { | |
| 214 | 221 | return false; |
| 215 | 222 | } |
| 216 | 223 | |
| 217 | 224 | // Docs. |