Make WordPress Core


Ignore:
Timestamp:
10/17/2015 01:20:19 AM (8 years ago)
Author:
SergeyBiryukov
Message:

Embeds: Rename files, functions, and hooks added in [34903] to make it more clear what is oEmbed-specific and what isn't.

See https://core.trac.wordpress.org/ticket/34272#comment:7 for full list of renamed functions and hooks.

Props swissspidy.
Fixes #34272.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/embed-functions.php

    r35228 r35235  
    465465    $output = "<script type='text/javascript'>\n";
    466466    if ( SCRIPT_DEBUG ) {
    467         $output .= file_get_contents( ABSPATH . WPINC . '/js/wp-oembed.js' );
     467        $output .= file_get_contents( ABSPATH . WPINC . '/js/wp-embed.js' );
    468468    } else {
    469469        /*
    470470         * If you're looking at a src version of this file, you'll see an "include"
    471471         * statement below. This is used by the `grunt build` process to directly
    472          * include a minified version of wp-oembed.js, instead of using the
     472         * include a minified version of wp-embed.js, instead of using the
    473473         * file_get_contents() method from above.
    474474         *
    475475         * If you're looking at a build version of this file, you'll see a string of
    476476         * minified JavaScript. If you need to debug it, please turn on SCRIPT_DEBUG
    477          * and edit wp-oembed.js directly.
     477         * and edit wp-embed.js directly.
    478478         */
    479479        $output .=<<<JS
    480         include "js/wp-oembed.min.js"
     480        include "js/wp-embed.min.js"
    481481JS;
    482482    }
     
    492492
    493493    /**
    494      * Filter the oEmbed HTML output.
     494     * Filter the embed HTML output for a given post.
    495495     *
    496496     * @since 4.4.0
     
    501501     * @param int     $height Height of the response.
    502502     */
    503     return apply_filters( 'oembed_html', $output, $post, $width, $height );
     503    return apply_filters( 'embed_html', $output, $post, $width, $height );
    504504}
    505505
     
    749749 * @return string The modified excerpt.
    750750 */
    751 function wp_oembed_excerpt_more( $more_string ) {
     751function wp_embed_excerpt_more( $more_string ) {
    752752    if ( ! is_embed() ) {
    753753        return $more_string;
     
    794794 * @return string The modified post excerpt.
    795795 */
    796 function wp_oembed_excerpt_attachment( $content ) {
     796function wp_embed_excerpt_attachment( $content ) {
    797797    if ( is_attachment() ) {
    798798        return prepend_attachment( '' );
     
    807807 * @since 4.4.0
    808808 */
    809 function print_oembed_embed_styles() {
     809function print_embed_styles() {
    810810    ?>
    811811    <style type="text/css">
    812812    <?php
    813813        if ( SCRIPT_DEBUG ) {
    814             readfile( ABSPATH . WPINC . "/css/wp-oembed-embed.css" );
     814            readfile( ABSPATH . WPINC . "/css/wp-embed-template.css" );
    815815        } else {
    816816            /*
     
    822822             * If you're looking at a build version of this file, you'll see a string of
    823823             * minified CSS. If you need to debug it, please turn on SCRIPT_DEBUG
    824              * and edit wp-oembed-embed.css directly.
     824             * and edit wp-embed-template.css directly.
    825825             */
    826826            ?>
    827             include "css/wp-oembed-embed.min.css"
     827            include "css/wp-embed-template.min.css"
    828828            <?php
    829829        }
     
    838838 * @since 4.4.0
    839839 */
    840 function print_oembed_embed_scripts() {
     840function print_embed_scripts() {
    841841    ?>
    842842    <script type="text/javascript">
    843843    <?php
    844844        if ( SCRIPT_DEBUG ) {
    845             readfile( ABSPATH . WPINC . "/js/wp-oembed-embed.js" );
     845            readfile( ABSPATH . WPINC . "/js/wp-embed-template.js" );
    846846        } else {
    847847            /*
    848848             * If you're looking at a src version of this file, you'll see an "include"
    849849             * statement below. This is used by the `grunt build` process to directly
    850              * include a minified version of wp-oembed-embed.js, instead of using the
     850             * include a minified version of wp-embed-template.js, instead of using the
    851851             * readfile() method from above.
    852852             *
    853853             * If you're looking at a build version of this file, you'll see a string of
    854854             * minified JavaScript. If you need to debug it, please turn on SCRIPT_DEBUG
    855              * and edit wp-oembed-embed.js directly.
     855             * and edit wp-embed-template.js directly.
    856856             */
    857857            ?>
    858             include "js/wp-oembed-embed.min.js"
     858            include "js/wp-embed-template.min.js"
    859859            <?php
    860860        }
Note: See TracChangeset for help on using the changeset viewer.