Changeset 35235
- Timestamp:
- 10/17/2015 01:20:19 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Gruntfile.js
r35203 r35235 234 234 // Exceptions 235 235 '!wp-includes/css/dashicons.css', 236 '!wp-includes/css/wp- oembed-embed.css'236 '!wp-includes/css/wp-embed-template.css' 237 237 ] 238 238 }, … … 531 531 dest: '.' 532 532 }, 533 oembed: {533 embed: { 534 534 src: BUILD_DIR + 'wp-includes/embed-functions.php', 535 535 dest: '.' … … 643 643 'concat:emoji', 644 644 'includes:emoji', 645 'includes: oembed',645 'includes:embed', 646 646 'jsvalidate:build' 647 647 ] ); -
trunk/src/wp-includes/default-filters.php
r35103 r35235 447 447 add_action( 'wp_head', 'wp_oembed_add_host_js' ); 448 448 449 add_action( ' oembed_head','print_emoji_detection_script' );450 add_action( ' oembed_head','print_emoji_styles' );451 add_action( ' oembed_head', 'print_oembed_embed_styles');452 add_action( ' oembed_head', 'print_oembed_embed_scripts');453 add_action( ' oembed_head','wp_print_head_scripts', 20 );454 add_action( ' oembed_head','wp_print_styles', 20 );455 add_action( ' oembed_head','wp_no_robots' );456 add_action( ' oembed_head','rel_canonical' );457 add_action( ' oembed_head','locale_stylesheet' );449 add_action( 'embed_head', 'print_emoji_detection_script' ); 450 add_action( 'embed_head', 'print_emoji_styles' ); 451 add_action( 'embed_head', 'print_embed_styles' ); 452 add_action( 'embed_head', 'print_embed_scripts' ); 453 add_action( 'embed_head', 'wp_print_head_scripts', 20 ); 454 add_action( 'embed_head', 'wp_print_styles', 20 ); 455 add_action( 'embed_head', 'wp_no_robots' ); 456 add_action( 'embed_head', 'rel_canonical' ); 457 add_action( 'embed_head', 'locale_stylesheet' ); 458 458 459 459 add_action( 'oembed_footer', 'wp_print_footer_scripts', 20 ); 460 460 461 add_filter( 'excerpt_more', 'wp_ oembed_excerpt_more',20 );461 add_filter( 'excerpt_more', 'wp_embed_excerpt_more', 20 ); 462 462 add_filter( 'the_excerpt_embed', 'wptexturize' ); 463 463 add_filter( 'the_excerpt_embed', 'convert_chars' ); 464 464 add_filter( 'the_excerpt_embed', 'wpautop' ); 465 465 add_filter( 'the_excerpt_embed', 'shortcode_unautop' ); 466 add_filter( 'the_excerpt_embed', 'wp_ oembed_excerpt_attachment');466 add_filter( 'the_excerpt_embed', 'wp_embed_excerpt_attachment' ); 467 467 468 468 add_filter( 'oembed_dataparse', 'wp_filter_oembed_result', 10, 3 ); -
trunk/src/wp-includes/embed-functions.php
r35228 r35235 465 465 $output = "<script type='text/javascript'>\n"; 466 466 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' ); 468 468 } else { 469 469 /* 470 470 * If you're looking at a src version of this file, you'll see an "include" 471 471 * statement below. This is used by the `grunt build` process to directly 472 * include a minified version of wp- oembed.js, instead of using the472 * include a minified version of wp-embed.js, instead of using the 473 473 * file_get_contents() method from above. 474 474 * 475 475 * If you're looking at a build version of this file, you'll see a string of 476 476 * 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. 478 478 */ 479 479 $output .=<<<JS 480 include "js/wp- oembed.min.js"480 include "js/wp-embed.min.js" 481 481 JS; 482 482 } … … 492 492 493 493 /** 494 * Filter the oEmbed HTML output.494 * Filter the embed HTML output for a given post. 495 495 * 496 496 * @since 4.4.0 … … 501 501 * @param int $height Height of the response. 502 502 */ 503 return apply_filters( ' oembed_html', $output, $post, $width, $height );503 return apply_filters( 'embed_html', $output, $post, $width, $height ); 504 504 } 505 505 … … 749 749 * @return string The modified excerpt. 750 750 */ 751 function wp_ oembed_excerpt_more( $more_string ) {751 function wp_embed_excerpt_more( $more_string ) { 752 752 if ( ! is_embed() ) { 753 753 return $more_string; … … 794 794 * @return string The modified post excerpt. 795 795 */ 796 function wp_ oembed_excerpt_attachment( $content ) {796 function wp_embed_excerpt_attachment( $content ) { 797 797 if ( is_attachment() ) { 798 798 return prepend_attachment( '' ); … … 807 807 * @since 4.4.0 808 808 */ 809 function print_ oembed_embed_styles() {809 function print_embed_styles() { 810 810 ?> 811 811 <style type="text/css"> 812 812 <?php 813 813 if ( SCRIPT_DEBUG ) { 814 readfile( ABSPATH . WPINC . "/css/wp- oembed-embed.css" );814 readfile( ABSPATH . WPINC . "/css/wp-embed-template.css" ); 815 815 } else { 816 816 /* … … 822 822 * If you're looking at a build version of this file, you'll see a string of 823 823 * 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. 825 825 */ 826 826 ?> 827 include "css/wp- oembed-embed.min.css"827 include "css/wp-embed-template.min.css" 828 828 <?php 829 829 } … … 838 838 * @since 4.4.0 839 839 */ 840 function print_ oembed_embed_scripts() {840 function print_embed_scripts() { 841 841 ?> 842 842 <script type="text/javascript"> 843 843 <?php 844 844 if ( SCRIPT_DEBUG ) { 845 readfile( ABSPATH . WPINC . "/js/wp- oembed-embed.js" );845 readfile( ABSPATH . WPINC . "/js/wp-embed-template.js" ); 846 846 } else { 847 847 /* 848 848 * If you're looking at a src version of this file, you'll see an "include" 849 849 * 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 the850 * include a minified version of wp-embed-template.js, instead of using the 851 851 * readfile() method from above. 852 852 * 853 853 * If you're looking at a build version of this file, you'll see a string of 854 854 * 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. 856 856 */ 857 857 ?> 858 include "js/wp- oembed-embed.min.js"858 include "js/wp-embed-template.min.js" 859 859 <?php 860 860 } -
trunk/src/wp-includes/embed-template.php
r35096 r35235 12 12 13 13 if ( ! headers_sent() ) { 14 header( 'X-WP- oembed: true' );14 header( 'X-WP-embed: true' ); 15 15 } 16 16 … … 29 29 * @since 4.4.0 30 30 */ 31 do_action( ' oembed_head' );31 do_action( 'embed_head' ); 32 32 ?> 33 33 </head> … … 67 67 * 68 68 * @since 4.4.0 69 * 69 * 70 70 * @param string $image_size Thumbnail image size. 71 71 */ 72 $image_size = apply_filters( ' oembed_thumbnail_image_size', $image_size );72 $image_size = apply_filters( 'embed_thumbnail_image_size', $image_size ); 73 73 74 74 $shape = $measurements[0] / $measurements[1] >= 1.75 ? 'rectangular' : 'square'; … … 84 84 * @param string $shape Thumbnail image shape. Either 'rectangular' or 'square'. 85 85 */ 86 $shape = apply_filters( ' oembed_thumbnail_image_shape', $shape );86 $shape = apply_filters( 'embed_thumbnail_image_shape', $shape ); 87 87 } 88 88 ?> … … 118 118 * @since 4.4.0 119 119 */ 120 do_action( ' oembed_content' );120 do_action( 'embed_content' ); 121 121 ?> 122 122 … … 133 133 * @param string $site_icon_url The site icon URL. 134 134 */ 135 $site_icon_url = apply_filters( ' oembed_site_icon_url', $site_icon_url );135 $site_icon_url = apply_filters( 'embed_site_icon_url', $site_icon_url ); 136 136 137 137 printf( … … 151 151 * @since 4.4.0 152 152 */ 153 do_action( ' oembed_content_meta');153 do_action( 'embed_content_meta'); 154 154 ?> 155 155 <?php if ( get_comments_number() || comments_open() ) : ?> … … 234 234 * @param string $site_icon_url The site icon URL. 235 235 */ 236 $site_icon_url = apply_filters( ' oembed_site_icon_url', $site_icon_url );236 $site_icon_url = apply_filters( 'embed_site_icon_url', $site_icon_url ); 237 237 238 238 printf( … … 254 254 * @since 4.4.0 255 255 */ 256 do_action( ' oembed_footer' );256 do_action( 'embed_footer' ); 257 257 ?> 258 258 </body> -
trunk/src/wp-includes/js/tinymce/plugins/wpoembed/plugin.js
r34903 r35235 9 9 id: scriptId, 10 10 type: 'text/javascript', 11 src: url + '/../../../wp- oembed.js'11 src: url + '/../../../wp-embed.js' 12 12 } ); 13 13 -
trunk/tests/phpunit/tests/oembed/template.php
r35225 r35235 187 187 } 188 188 189 function test_wp_ oembed_excerpt_more_no_embed() {189 function test_wp_embed_excerpt_more_no_embed() { 190 190 $GLOBALS['wp_query'] = new WP_Query(); 191 191 192 $this->assertEquals( 'foo bar', wp_ oembed_excerpt_more( 'foo bar' ) );193 } 194 195 function test_wp_ oembed_excerpt_more() {196 $post_id = self::$factory->post->create( array( 197 'post_content' => 'Foo Bar', 198 ) ); 199 200 $this->assertEquals( '', wp_ oembed_excerpt_more( '' ) );201 202 $this->go_to( get_post_embed_url( $post_id ) ); 203 204 $actual = wp_ oembed_excerpt_more( '' );192 $this->assertEquals( 'foo bar', wp_embed_excerpt_more( 'foo bar' ) ); 193 } 194 195 function test_wp_embed_excerpt_more() { 196 $post_id = self::$factory->post->create( array( 197 'post_content' => 'Foo Bar', 198 ) ); 199 200 $this->assertEquals( '', wp_embed_excerpt_more( '' ) ); 201 202 $this->go_to( get_post_embed_url( $post_id ) ); 203 204 $actual = wp_embed_excerpt_more( '' ); 205 205 206 206 $expected = sprintf(
Note: See TracChangeset
for help on using the changeset viewer.