| @@ 22-30 (lines=9) @@ | ||
| 19 | ||
| 20 | add_shortcode( 'hulu', 'jetpack_hulu_shortcode' ); |
|
| 21 | ||
| 22 | if ( |
|
| 23 | ! is_admin() |
|
| 24 | /** This filter is documented in modules/shortcodes/youtube.php */ |
|
| 25 | && apply_filters( 'jetpack_comments_allow_oembed', true ) |
|
| 26 | // No need for this on WordPress.com, this is done for multiple shortcodes at a time there. |
|
| 27 | && ( ! defined( 'IS_WPCOM' ) || ! IS_WPCOM ) |
|
| 28 | ) { |
|
| 29 | add_filter( 'comment_text', 'jetpack_hulu_link', 1 ); |
|
| 30 | } |
|
| 31 | ||
| 32 | /** |
|
| 33 | * Return a Hulu video ID from a given set to attributes. |
|
| @@ 391-404 (lines=14) @@ | ||
| 388 | return $matches[0]; |
|
| 389 | } |
|
| 390 | ||
| 391 | if ( |
|
| 392 | ! is_admin() |
|
| 393 | /** This filter is documented in modules/shortcodes/youtube.php */ |
|
| 394 | && apply_filters( 'jetpack_comments_allow_oembed', true ) |
|
| 395 | // No need for this on WordPress.com, this is done for multiple shortcodes at a time there. |
|
| 396 | && ( ! defined( 'IS_WPCOM' ) || ! IS_WPCOM ) |
|
| 397 | ) { |
|
| 398 | /* |
|
| 399 | * We attach wp_kses_post to comment_text in default-filters.php with priority of 10 anyway, |
|
| 400 | * so the iframe gets filtered out. |
|
| 401 | * Higher priority because we need it before auto-link and autop get to it |
|
| 402 | */ |
|
| 403 | add_filter( 'comment_text', 'vimeo_link', 1 ); |
|
| 404 | } |
|
| 405 | ||
| @@ 470-491 (lines=22) @@ | ||
| 467 | } |
|
| 468 | add_action( 'init', 'wpcom_youtube_embed_crazy_url_init' ); |
|
| 469 | ||
| 470 | if ( |
|
| 471 | ! is_admin() |
|
| 472 | /** |
|
| 473 | * Allow oEmbeds in Jetpack's Comment form. |
|
| 474 | * |
|
| 475 | * @module shortcodes |
|
| 476 | * |
|
| 477 | * @since 2.8.0 |
|
| 478 | * |
|
| 479 | * @param int $allow_oembed Option to automatically embed all plain text URLs. |
|
| 480 | */ |
|
| 481 | && apply_filters( 'jetpack_comments_allow_oembed', true ) |
|
| 482 | // No need for this on WordPress.com, this is done for multiple shortcodes at a time there. |
|
| 483 | && ( ! defined( 'IS_WPCOM' ) || ! IS_WPCOM ) |
|
| 484 | ) { |
|
| 485 | /* |
|
| 486 | * We attach wp_kses_post to comment_text in default-filters.php with priority of 10 anyway, |
|
| 487 | * so the iframe gets filtered out. |
|
| 488 | * Higher priority because we need it before auto-link and autop get to it. |
|
| 489 | */ |
|
| 490 | add_filter( 'comment_text', 'youtube_link', 1 ); |
|
| 491 | } |
|
| 492 | ||
| 493 | /** |
|
| 494 | * Core changes to do_shortcode (https://core.trac.wordpress.org/changeset/34747) broke "improper" shortcodes |
|