diff --git a/wp-admin/includes/ajax-actions.php b/wp-admin/includes/ajax-actions.php
index 6a197c7..b6bd757 100644
|
a
|
b
|
function wp_ajax_parse_embed() {
|
| 2980 | 2980 | $styles .= sprintf( '<link rel="stylesheet" href="%s"/>', $style ); |
| 2981 | 2981 | } |
| 2982 | 2982 | |
| 2983 | | $html = apply_shortcodes( $parsed ); |
| | 2983 | $html = do_shortcode( $parsed ); |
| 2984 | 2984 | |
| 2985 | 2985 | global $wp_scripts; |
| 2986 | 2986 | if ( ! empty( $wp_scripts ) ) { |
| … |
… |
function wp_ajax_parse_media_shortcode() {
|
| 3037 | 3037 | setup_postdata( $post ); |
| 3038 | 3038 | } |
| 3039 | 3039 | |
| 3040 | | $parsed = apply_shortcodes( $shortcode ); |
| | 3040 | $parsed = do_shortcode( $shortcode ); |
| 3041 | 3041 | |
| 3042 | 3042 | if ( empty( $parsed ) ) { |
| 3043 | 3043 | wp_send_json_error( array( |
diff --git a/wp-includes/class-wp-embed.php b/wp-includes/class-wp-embed.php
index a20bb3a..a8ce4d6 100644
|
a
|
b
|
class WP_Embed {
|
| 48 | 48 | * |
| 49 | 49 | * Since the [embed] shortcode needs to be run earlier than other shortcodes, |
| 50 | 50 | * this function removes all existing shortcodes, registers the [embed] shortcode, |
| 51 | | * calls apply_shortcodes(), and then re-registers the old shortcodes. |
| | 51 | * calls do_shortcode(), and then re-registers the old shortcodes. |
| 52 | 52 | * |
| 53 | 53 | * @global array $shortcode_tags |
| 54 | 54 | * |
| … |
… |
class WP_Embed {
|
| 65 | 65 | add_shortcode( 'embed', array( $this, 'shortcode' ) ); |
| 66 | 66 | |
| 67 | 67 | // Do the shortcode (only the [embed] one is registered) |
| 68 | | $content = apply_shortcodes( $content, true ); |
| | 68 | $content = do_shortcode( $content, true ); |
| 69 | 69 | |
| 70 | 70 | // Put the original shortcodes back |
| 71 | 71 | $shortcode_tags = $orig_shortcode_tags; |
| … |
… |
class WP_Embed {
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | /** |
| 127 | | * The allby_shortcodes() callback function. |
| | 127 | * The do_shortcode() callback function. |
| 128 | 128 | * |
| 129 | 129 | * Attempts to convert a URL into embed HTML. Starts by checking the URL against the regex of |
| 130 | 130 | * the registered embed handlers. If none of the regex matches and it's enabled, then the URL |
diff --git a/wp-includes/default-filters.php b/wp-includes/default-filters.php
index 40ec96a..3402e48 100644
|
a
|
b
|
add_action( 'template_redirect', 'redirect_canonical' );
|
| 430 | 430 | add_action( 'template_redirect', 'wp_redirect_admin_locations', 1000 ); |
| 431 | 431 | |
| 432 | 432 | // Shortcodes |
| 433 | | add_filter( 'the_content', 'apply_shortcodes', 11 ); // AFTER wpautop() |
| | 433 | add_filter( 'the_content', 'do_shortcode', 11 ); // AFTER wpautop() |
| 434 | 434 | |
| 435 | 435 | // Media |
| 436 | 436 | add_action( 'wp_playlist_scripts', 'wp_playlist_scripts' ); |
diff --git a/wp-includes/deprecated.php b/wp-includes/deprecated.php
index 618e680..48f0173 100644
|
a
|
b
|
function wp_embed_handler_googlevideo( $matches, $attr, $url, $rawattr ) {
|
| 3758 | 3758 | |
| 3759 | 3759 | return ''; |
| 3760 | 3760 | } |
| 3761 | | |
| 3762 | | /** |
| 3763 | | * Search content for shortcodes and filter shortcodes through their hooks. |
| 3764 | | * |
| 3765 | | * If there are no shortcode tags defined, then the content will be returned |
| 3766 | | * without any filtering. This might cause issues when plugins are disabled but |
| 3767 | | * the shortcode will still show up in the post or content. |
| 3768 | | * |
| 3769 | | * @since 2.5.0 |
| 3770 | | * |
| 3771 | | * @global array $shortcode_tags List of shortcode tags and their callback hooks. |
| 3772 | | * |
| 3773 | | * @param string $content Content to search for shortcodes. |
| 3774 | | * @param bool $ignore_html When true, shortcodes inside HTML elements will be skipped. |
| 3775 | | * @return string Content with shortcodes filtered out. |
| 3776 | | */ |
| 3777 | | function do_shortcode( $content, $ignore_html = false ) { |
| 3778 | | _deprecated_function( __FUNCTION__, '4.7.0', 'apply_shortcodes' ); |
| 3779 | | |
| 3780 | | return apply_shortcodes( $content, $ignore_html ); |
| 3781 | | } |
| 3782 | | No newline at end of file |
diff --git a/wp-includes/media.php b/wp-includes/media.php
index 71fa14d..fd3bf43 100644
|
a
|
b
|
function img_caption_shortcode( $attr, $content = null ) {
|
| 1571 | 1571 | |
| 1572 | 1572 | if ( $html5 ) { |
| 1573 | 1573 | $html = '<figure ' . $atts['id'] . $style . 'class="' . esc_attr( $class ) . '">' |
| 1574 | | . apply_shortcodes( $content ) . '<figcaption class="wp-caption-text">' . $atts['caption'] . '</figcaption></figure>'; |
| | 1574 | . do_shortcode( $content ) . '<figcaption class="wp-caption-text">' . $atts['caption'] . '</figcaption></figure>'; |
| 1575 | 1575 | } else { |
| 1576 | 1576 | $html = '<div ' . $atts['id'] . $style . 'class="' . esc_attr( $class ) . '">' |
| 1577 | | . apply_shortcodes( $content ) . '<p class="wp-caption-text">' . $atts['caption'] . '</p></div>'; |
| | 1577 | . do_shortcode( $content ) . '<p class="wp-caption-text">' . $atts['caption'] . '</p></div>'; |
| 1578 | 1578 | } |
| 1579 | 1579 | |
| 1580 | 1580 | return $html; |
diff --git a/wp-includes/shortcodes.php b/wp-includes/shortcodes.php
index e6bd9c4..b2aad3d 100644
|
a
|
b
|
|
| 21 | 21 | * |
| 22 | 22 | * To apply shortcode tags to content: |
| 23 | 23 | * |
| 24 | | * $out = apply_shortcodes( $content ); |
| | 24 | * $out = do_shortcode( $content ); |
| 25 | 25 | * |
| 26 | 26 | * @link https://codex.wordpress.org/Shortcode_API |
| 27 | 27 | * |
| … |
… |
function has_shortcode( $content, $tag ) {
|
| 199 | 199 | * @param bool $ignore_html When true, shortcodes inside HTML elements will be skipped. |
| 200 | 200 | * @return string Content with shortcodes filtered out. |
| 201 | 201 | */ |
| 202 | | function apply_shortcodes( $content, $ignore_html = false ) { |
| | 202 | function do_shortcode( $content, $ignore_html = false ) { |
| 203 | 203 | global $shortcode_tags; |
| 204 | 204 | |
| 205 | 205 | if ( false === strpos( $content, '[' ) ) { |
| … |
… |
function get_shortcode_regex( $tagnames = null ) {
|
| 292 | 292 | } |
| 293 | 293 | |
| 294 | 294 | /** |
| 295 | | * Regular Expression callable for apply_shortcodes() for calling shortcode hook. |
| | 295 | * Regular Expression callable for do_shortcode() for calling shortcode hook. |
| 296 | 296 | * @see get_shortcode_regex for details of the match array contents. |
| 297 | 297 | * |
| 298 | 298 | * @since 2.5.0 |