Changeset 44155
- Timestamp:
- 12/14/2018 03:24:35 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-content/themes/twentynineteen/classes/class-twentynineteen-svg-icons.php
r44149 r44155 72 72 */ 73 73 static $ui_icons = array( 74 'link' => /* material-design – link */ '74 'link' => /* material-design – link */ ' 75 75 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> 76 76 <path d="M0 0h24v24H0z" fill="none"></path> … … 78 78 </svg>', 79 79 80 'watch' => /* material-design – watch-later */ '80 'watch' => /* material-design – watch-later */ ' 81 81 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> 82 82 <defs> … … 89 89 </svg>', 90 90 91 'archive' => /* material-design – folder */ '91 'archive' => /* material-design – folder */ ' 92 92 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> 93 93 <path d="M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z"></path> … … 95 95 </svg>', 96 96 97 'tag' => /* material-design – local_offer */ '97 'tag' => /* material-design – local_offer */ ' 98 98 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> 99 99 <path d="M21.41 11.58l-9-9C12.05 2.22 11.55 2 11 2H4c-1.1 0-2 .9-2 2v7c0 .55.22 1.05.59 1.42l9 9c.36.36.86.58 1.41.58.55 0 1.05-.22 1.41-.59l7-7c.37-.36.59-.86.59-1.41 0-.55-.23-1.06-.59-1.42zM5.5 7C4.67 7 4 6.33 4 5.5S4.67 4 5.5 4 7 4.67 7 5.5 6.33 7 5.5 7z"></path> … … 101 101 </svg>', 102 102 103 'comment' => /* material-design – comment */ '103 'comment' => /* material-design – comment */ ' 104 104 <svg viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> 105 105 <path d="M21.99 4c0-1.1-.89-2-1.99-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h14l4 4-.01-18z"></path> … … 107 107 </svg>', 108 108 109 'person' => /* material-design – person */ '109 'person' => /* material-design – person */ ' 110 110 <svg viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> 111 111 <path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"></path> … … 113 113 </svg>', 114 114 115 'edit' => /* material-design – edit */ '115 'edit' => /* material-design – edit */ ' 116 116 <svg viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> 117 117 <path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"></path> … … 119 119 </svg>', 120 120 121 'chevron_left' => /* material-design – chevron_left */ '121 'chevron_left' => /* material-design – chevron_left */ ' 122 122 <svg viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> 123 123 <path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"></path> … … 125 125 </svg>', 126 126 127 'chevron_right' => /* material-design – chevron_right */ '127 'chevron_right' => /* material-design – chevron_right */ ' 128 128 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> 129 129 <path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"></path> … … 131 131 </svg>', 132 132 133 'check' => /* material-design – check */ '133 'check' => /* material-design – check */ ' 134 134 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> 135 135 <path d="M0 0h24v24H0z" fill="none"></path> … … 137 137 </svg>', 138 138 139 'arrow_drop_down_circle' => /* material-design – arrow_drop_down_circle */ '139 'arrow_drop_down_circle' => /* material-design – arrow_drop_down_circle */ ' 140 140 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> 141 141 <path d="M0 0h24v24H0z" fill="none"></path> … … 143 143 </svg>', 144 144 145 'keyboard_arrow_down' => /* material-design – keyboard_arrow_down */ '145 'keyboard_arrow_down' => /* material-design – keyboard_arrow_down */ ' 146 146 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> 147 147 <path d="M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"></path> … … 149 149 </svg>', 150 150 151 'keyboard_arrow_right' => /* material-design – keyboard_arrow_right */ '151 'keyboard_arrow_right' => /* material-design – keyboard_arrow_right */ ' 152 152 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> 153 153 <path d="M10 17l5-5-5-5v10z"></path> … … 155 155 </svg>', 156 156 157 'keyboard_arrow_left' => /* material-design – keyboard_arrow_left */ '157 'keyboard_arrow_left' => /* material-design – keyboard_arrow_left */ ' 158 158 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"> 159 159 <path d="M14 7l-5 5 5 5V7z"></path> … … 206 206 'fb.me', 207 207 ), 208 'feed' => array(208 'feed' => array( 209 209 'feed', 210 210 ), … … 212 212 'plus.google.com', 213 213 ), 214 'lastfm' => array(214 'lastfm' => array( 215 215 'last.fm', 216 216 ), 217 'mail' => array(217 'mail' => array( 218 218 'mailto:', 219 219 ), … … 344 344 </svg>', 345 345 346 'lastfm' => '346 'lastfm' => ' 347 347 <svg viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> 348 348 <path d="M10.5002,0 C4.7006,0 0,4.70109753 0,10.4998496 C0,16.2989526 4.7006,21 10.5002,21 C16.299,21 21,16.2989526 21,10.4998496 C21,4.70109753 16.299,0 10.5002,0 Z M14.69735,14.7204413 C13.3164,14.7151781 12.4346,14.0870017 11.83445,12.6859357 L11.6816001,12.3451305 L10.35405,9.31011397 C9.92709997,8.26875064 8.85260001,7.57120012 7.68010001,7.57120012 C6.06945001,7.57120012 4.75925001,8.88509738 4.75925001,10.5009524 C4.75925001,12.1164565 6.06945001,13.4303036 7.68010001,13.4303036 C8.77200001,13.4303036 9.76514999,12.827541 10.2719501,11.8567047 C10.2893,11.8235214 10.3239,11.8019673 10.36305,11.8038219 C10.4007,11.8053759 10.43535,11.8287847 10.4504,11.8631709 L10.98655,13.1045863 C11.0016,13.1389726 10.9956,13.17782 10.97225,13.2068931 C10.1605001,14.1995341 8.96020001,14.7683115 7.68010001,14.7683115 C5.33305,14.7683115 3.42340001,12.8535563 3.42340001,10.5009524 C3.42340001,8.14679459 5.33300001,6.23203946 7.68010001,6.23203946 C9.45720002,6.23203946 10.8909,7.19074535 11.6138,8.86359341 C11.6205501,8.88018505 12.3412,10.5707777 12.97445,12.0190621 C13.34865,12.8739575 13.64615,13.3959676 14.6288,13.4291508 C15.5663001,13.4612814 16.25375,12.9121534 16.25375,12.1484869 C16.25375,11.4691321 15.8320501,11.3003585 14.8803,10.98216 C13.2365,10.4397989 12.34495,9.88605929 12.34495,8.51817658 C12.34495,7.1809207 13.26665,6.31615054 14.692,6.31615054 C15.62875,6.31615054 16.3155,6.7286858 16.79215,7.5768142 C16.80495,7.60062396 16.8079001,7.62814302 16.8004001,7.65420843 C16.7929,7.68027384 16.7748,7.70212868 16.7507001,7.713808 L15.86145,8.16900031 C15.8178001,8.19200805 15.7643,8.17807308 15.73565,8.13847371 C15.43295,7.71345711 15.0956,7.52513451 14.6423,7.52513451 C14.05125,7.52513451 13.6220001,7.92899802 13.6220001,8.48649708 C13.6220001,9.17382194 14.1529001,9.34144259 15.0339,9.61923972 C15.14915,9.65578139 15.26955,9.69397731 15.39385,9.73432853 C16.7763,10.1865133 17.57675,10.7311301 17.57675,12.1836251 C17.57685,13.629654 16.3389,14.7204413 14.69735,14.7204413 Z"></path> -
trunk/src/wp-content/themes/twentynineteen/classes/class-twentynineteen-walker-comment.php
r44149 r44155 38 38 $comment_author = get_comment_author( $comment ); 39 39 $avatar = get_avatar( $comment, $args['avatar_size'] ); 40 if ( 0 != $args['avatar_size'] ) { 41 if ( empty( $comment_author_url ) ) { 42 echo $avatar; 43 } else { 44 printf( '<a href="%s" rel="external nofollow" class="url">', $comment_author_url ); 45 echo $avatar; 46 } 40 if ( 0 != $args['avatar_size'] ) { 41 if ( empty( $comment_author_url ) ) { 42 echo $avatar; 43 } else { 44 printf( '<a href="%s" rel="external nofollow" class="url">', $comment_author_url ); 45 echo $avatar; 47 46 } 47 } 48 48 49 49 /* … … 51 51 * fill color to the inner check shape when in circle form. 52 52 */ 53 54 55 56 53 if ( twentynineteen_is_comment_by_post_author( $comment ) ) { 54 /* translators: %s: SVG Icon */ 55 printf( '<span class="post-author-badge" aria-hidden="true">%s</span>', twentynineteen_get_icon_svg( 'check', 24 ) ); 56 } 57 57 58 58 printf( … … 62 62 ); 63 63 64 65 66 64 if ( ! empty( $comment_author_url ) ) { 65 echo '</a>'; 66 } 67 67 ?> 68 68 </div><!-- .comment-author --> -
trunk/src/wp-content/themes/twentynineteen/comments.php
r44149 r44155 29 29 <h2 class="comments-title"> 30 30 <?php 31 if ( comments_open() ) { 32 if ( have_comments() ) { 33 _e( 'Join the Conversation', 'twentynineteen' ); 34 } else { 35 _e( 'Leave a comment', 'twentynineteen' ); 36 } 31 if ( comments_open() ) { 32 if ( have_comments() ) { 33 _e( 'Join the Conversation', 'twentynineteen' ); 37 34 } else { 38 if ( '1' == $discussion->responses ) { 39 /* translators: %s: post title */ 40 printf( _x( 'One reply on “%s”', 'comments title', 'twentynineteen' ), get_the_title() ); 41 } else { 42 printf( 43 /* translators: 1: number of comments, 2: post title */ 44 _nx( 45 '%1$s reply on “%2$s”', 46 '%1$s replies on “%2$s”', 47 $discussion->responses, 48 'comments title', 49 'twentynineteen' 50 ), 51 number_format_i18n( $discussion->responses ), 52 get_the_title() 53 ); 54 } 35 _e( 'Leave a comment', 'twentynineteen' ); 55 36 } 37 } else { 38 if ( '1' == $discussion->responses ) { 39 /* translators: %s: post title */ 40 printf( _x( 'One reply on “%s”', 'comments title', 'twentynineteen' ), get_the_title() ); 41 } else { 42 printf( 43 /* translators: 1: number of comments, 2: post title */ 44 _nx( 45 '%1$s reply on “%2$s”', 46 '%1$s replies on “%2$s”', 47 $discussion->responses, 48 'comments title', 49 'twentynineteen' 50 ), 51 number_format_i18n( $discussion->responses ), 52 get_the_title() 53 ); 54 } 55 } 56 56 ?> 57 57 </h2><!-- .comments-title --> 58 58 <?php 59 59 // Only show discussion meta information when comments are open and available. 60 60 if ( have_comments() && comments_open() ) { 61 61 get_template_part( 'template-parts/post/discussion', 'meta' ); 62 62 } 63 63 ?> 64 64 </div><!-- .comments-title-flex --> -
trunk/src/wp-content/themes/twentynineteen/image.php
r44149 r44155 16 16 <?php 17 17 // Start the loop. 18 19 20 ?>18 while ( have_posts() ) : 19 the_post(); 20 ?> 21 21 22 22 <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 23 23 24 24 <header class="entry-header"> 25 25 <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?> 26 26 </header><!-- .entry-header --> 27 27 … … 29 29 30 30 <figure class="entry-attachment wp-block-image"> 31 32 33 34 35 36 37 38 39 31 <?php 32 /** 33 * Filter the default twentynineteen image attachment size. 34 * 35 * @since Twenty Sixteen 1.0 36 * 37 * @param string $image_size Image size. Default 'large'. 38 */ 39 $image_size = apply_filters( 'twentynineteen_attachment_size', 'full' ); 40 40 41 42 41 echo wp_get_attachment_image( get_the_ID(), $image_size ); 42 ?> 43 43 44 44 <figcaption class="wp-caption-text"><?php echo get_the_excerpt(); ?></figcaption> … … 47 47 48 48 <?php 49 50 51 52 53 54 55 56 57 58 59 49 the_content(); 50 wp_link_pages( 51 array( 52 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentynineteen' ) . '</span>', 53 'after' => '</div>', 54 'link_before' => '<span>', 55 'link_after' => '</span>', 56 'pagelink' => '<span class="screen-reader-text">' . __( 'Page', 'twentynineteen' ) . ' </span>%', 57 'separator' => '<span class="screen-reader-text">, </span>', 58 ) 59 ); 60 60 ?> 61 61 </div><!-- .entry-content --> 62 62 63 63 <footer class="entry-footer"> 64 65 66 67 68 69 70 71 72 73 74 75 76 64 <?php 65 // Retrieve attachment metadata. 66 $metadata = wp_get_attachment_metadata(); 67 if ( $metadata ) { 68 printf( 69 '<span class="full-size-link"><span class="screen-reader-text">%1$s</span><a href="%2$s">%3$s × %4$s</a></span>', 70 _x( 'Full size', 'Used before full size attachment link.', 'twentynineteen' ), 71 esc_url( wp_get_attachment_url() ), 72 absint( $metadata['width'] ), 73 absint( $metadata['height'] ) 74 ); 75 } 76 ?> 77 77 78 78 <?php twentynineteen_entry_footer(); ?> … … 82 82 83 83 <?php 84 85 86 87 88 89 84 // Parent post navigation. 85 the_post_navigation( 86 array( 87 'prev_text' => _x( '<span class="meta-nav">Published in</span><br><span class="post-title">%title</span>', 'Parent post link', 'twentynineteen' ), 88 ) 89 ); 90 90 91 92 93 94 91 // If comments are open or we have at least one comment, load up the comment template. 92 if ( comments_open() || get_comments_number() ) { 93 comments_template(); 94 } 95 95 96 96 // End the loop. -
trunk/src/wp-content/themes/twentynineteen/inc/color-patterns.php
r44149 r44155 27 27 */ 28 28 29 $saturation 30 $saturation 29 $saturation = absint( apply_filters( 'twentynineteen_custom_colors_saturation', 100 ) ); 30 $saturation = $saturation . '%'; 31 31 32 32 $saturation_selection = absint( apply_filters( 'twentynineteen_custom_colors_saturation_selection', 50 ) ); 33 33 $saturation_selection = $saturation_selection . '%'; 34 34 35 $lightness 36 $lightness 37 38 $lightness_hover 39 $lightness_hover 40 41 $lightness_selection 42 $lightness_selection 35 $lightness = absint( apply_filters( 'twentynineteen_custom_colors_lightness', 33 ) ); 36 $lightness = $lightness . '%'; 37 38 $lightness_hover = absint( apply_filters( 'twentynineteen_custom_colors_lightness_hover', 23 ) ); 39 $lightness_hover = $lightness_hover . '%'; 40 41 $lightness_selection = absint( apply_filters( 'twentynineteen_custom_colors_lightness_selection', 90 ) ); 42 $lightness_selection = $lightness_selection . '%'; 43 43 44 44 $theme_css = ' … … 234 234 } 235 235 '; 236 $css = '';236 $css = ''; 237 237 if ( function_exists( 'register_block_type' ) && is_admin() ) { 238 238 $css .= $editor_css; 239 } else 239 } elseif ( ! is_admin() ) { 240 240 $css = $theme_css; 241 241 } -
trunk/src/wp-content/themes/twentynineteen/inc/customizer.php
r44149 r44155 53 53 'label' => __( 'Primary Color', 'twentynineteen' ), 54 54 'choices' => array( 55 'default' 56 'custom' => _x( 'Custom', 'primary color', 'twentynineteen' ),55 'default' => _x( 'Default', 'primary color', 'twentynineteen' ), 56 'custom' => _x( 'Custom', 'primary color', 'twentynineteen' ), 57 57 ), 58 58 'section' => 'colors', -
trunk/src/wp-content/themes/twentynineteen/inc/template-functions.php
r44149 r44155 365 365 $mid2; 366 366 367 $m = $l + $l - $v;368 $sv = ( $v - $m ) / $v;369 $h *= 6.0;367 $m = $l + $l - $v; 368 $sv = ( $v - $m ) / $v; 369 $h *= 6.0; 370 370 $sextant = floor( $h ); 371 $fract = $h - $sextant;372 $vsf = $v * $sv * $fract;373 $mid1 = $m + $vsf;374 $mid2 = $v - $vsf;371 $fract = $h - $sextant; 372 $vsf = $v * $sv * $fract; 373 $mid1 = $m + $vsf; 374 $mid2 = $v - $vsf; 375 375 376 376 switch ( $sextant ) { -
trunk/src/wp-content/themes/twentynineteen/inc/template-tags.php
r44149 r44155 211 211 comment_form( 212 212 array( 213 'logged_in_as' 214 'title_reply' 213 'logged_in_as' => null, 214 'title_reply' => null, 215 215 ) 216 216 ); -
trunk/src/wp-content/themes/twentynineteen/template-parts/content/content-single.php
r44149 r44155 50 50 51 51 <?php if ( ! is_singular( 'attachment' ) ) : ?> 52 <?php get_template_part( 'template-parts/post/author', 'bio' ); ?>52 <?php get_template_part( 'template-parts/post/author', 'bio' ); ?> 53 53 <?php endif; ?> 54 54 -
trunk/src/wp-content/themes/twentynineteen/template-parts/footer/footer-widgets.php
r43842 r44155 12 12 <aside class="widget-area" role="complementary" aria-label="<?php esc_attr_e( 'Footer', 'twentynineteen' ); ?>"> 13 13 <?php 14 15 14 if ( is_active_sidebar( 'sidebar-1' ) ) { 15 ?> 16 16 <div class="widget-column footer-widget-1"> 17 17 <?php dynamic_sidebar( 'sidebar-1' ); ?> 18 18 </div> 19 19 <?php 20 20 } 21 21 ?> 22 22 </aside><!-- .widget-area --> -
trunk/src/wp-includes/embed.php
r44154 r44155 62 62 */ 63 63 function wp_embed_defaults( $url = '' ) { 64 if ( ! empty( $GLOBALS['content_width'] ) ) 64 if ( ! empty( $GLOBALS['content_width'] ) ) { 65 65 $width = (int) $GLOBALS['content_width']; 66 67 if ( empty( $width ) ) 66 } 67 68 if ( empty( $width ) ) { 68 69 $width = 500; 70 } 69 71 70 72 $height = min( ceil( $width * 1.5 ), 1000 ); … … 132 134 function wp_oembed_add_provider( $format, $provider, $regex = false ) { 133 135 if ( did_action( 'plugins_loaded' ) ) { 134 $oembed = _wp_oembed_get_object();135 $oembed->providers[ $format] = array( $provider, $regex );136 $oembed = _wp_oembed_get_object(); 137 $oembed->providers[ $format ] = array( $provider, $regex ); 136 138 } else { 137 139 WP_oEmbed::_add_provider_early( $format, $provider, $regex ); … … 227 229 function wp_embed_handler_youtube( $matches, $attr, $url, $rawattr ) { 228 230 global $wp_embed; 229 $embed = $wp_embed->autoembed( sprintf( "https://youtube.com/watch?v=%s", urlencode( $matches[2] ) ) );231 $embed = $wp_embed->autoembed( sprintf( 'https://youtube.com/watch?v=%s', urlencode( $matches[2] ) ) ); 230 232 231 233 /** … … 396 398 397 399 if ( '' !== $permalink ) { 398 $url = add_query_arg( array( 399 'url' => urlencode( $permalink ), 400 'format' => ( 'json' !== $format ) ? $format : false, 401 ), $url ); 400 $url = add_query_arg( 401 array( 402 'url' => urlencode( $permalink ), 403 'format' => ( 'json' !== $format ) ? $format : false, 404 ), 405 $url 406 ); 402 407 } 403 408 … … 450 455 * and edit wp-embed.js directly. 451 456 */ 452 $output .= <<<JS457 $output .= <<<JS 453 458 include "js/wp-embed.min.js" 454 459 JS; … … 518 523 * } 519 524 */ 520 $min_max_width = apply_filters( 'oembed_min_max_width', array( 521 'min' => 200, 522 'max' => 600 523 ) ); 525 $min_max_width = apply_filters( 526 'oembed_min_max_width', 527 array( 528 'min' => 200, 529 'max' => 600, 530 ) 531 ); 524 532 525 533 $width = min( max( $min_max_width['min'], $width ), $min_max_width['max'] ); … … 570 578 571 579 if ( is_multisite() ) { 572 $url_parts = wp_parse_args( wp_parse_url( $url ), array( 573 'host' => '', 580 $url_parts = wp_parse_args( 581 wp_parse_url( $url ), 582 array( 583 'host' => '', 584 'path' => '/', 585 ) 586 ); 587 588 $qv = array( 589 'domain' => $url_parts['host'], 574 590 'path' => '/', 575 ) ); 576 577 $qv = array( 'domain' => $url_parts['host'], 'path' => '/' ); 591 ); 578 592 579 593 // In case of subdirectory configs, set the path. … … 648 662 if ( wp_attachment_is_image( $post ) ) { 649 663 $thumbnail_id = $post->ID; 650 } else 664 } elseif ( wp_attachment_is( 'video', $post ) ) { 651 665 $thumbnail_id = get_post_thumbnail_id( $post ); 652 666 $data['type'] = 'video'; … … 656 670 if ( $thumbnail_id ) { 657 671 list( $thumbnail_url, $thumbnail_width, $thumbnail_height ) = wp_get_attachment_image_src( $thumbnail_id, array( $width, 99999 ) ); 658 $data['thumbnail_url'] = $thumbnail_url;659 $data['thumbnail_width'] = $thumbnail_width;660 $data['thumbnail_height'] = $thumbnail_height;672 $data['thumbnail_url'] = $thumbnail_url; 673 $data['thumbnail_width'] = $thumbnail_width; 674 $data['thumbnail_height'] = $thumbnail_height; 661 675 } 662 676 … … 795 809 $allowed_html = array( 796 810 'a' => array( 797 'href' 811 'href' => true, 798 812 ), 799 813 'blockquote' => array(), … … 825 839 826 840 $url = esc_url( "{$results[2]}#?secret=$secret" ); 827 $q = $results[1];841 $q = $results[1]; 828 842 829 843 $html = str_replace( $results[0], ' src=' . $q . $url . $q . ' data-secret=' . $q . $secret . $q, $html ); … … 832 846 833 847 $allowed_html['blockquote']['data-secret'] = true; 834 $allowed_html['iframe']['data-secret'] = true;848 $allowed_html['iframe']['data-secret'] = true; 835 849 836 850 $html = wp_kses( $html, $allowed_html ); … … 863 877 } 864 878 865 $link = sprintf( '<a href="%1$s" class="wp-embed-more" target="_top">%2$s</a>', 879 $link = sprintf( 880 '<a href="%1$s" class="wp-embed-more" target="_top">%2$s</a>', 866 881 esc_url( get_permalink() ), 867 882 /* translators: %s: Name of current post */ … … 939 954 <style type="text/css"> 940 955 <?php 941 942 readfile( ABSPATH . WPINC . "/css/wp-embed-template.css");943 944 945 946 947 948 949 950 951 952 953 954 956 if ( SCRIPT_DEBUG ) { 957 readfile( ABSPATH . WPINC . '/css/wp-embed-template.css' ); 958 } else { 959 /* 960 * If you're looking at a src version of this file, you'll see an "include" 961 * statement below. This is used by the `grunt build` process to directly 962 * include a minified version of wp-oembed-embed.css, instead of using the 963 * readfile() method from above. 964 * 965 * If you're looking at a build version of this file, you'll see a string of 966 * minified CSS. If you need to debug it, please turn on SCRIPT_DEBUG 967 * and edit wp-embed-template.css directly. 968 */ 969 ?> 955 970 include "css/wp-embed-template.min.css" 956 957 971 <?php 972 } 958 973 ?> 959 974 </style> … … 970 985 <script type="text/javascript"> 971 986 <?php 972 973 readfile( ABSPATH . WPINC . "/js/wp-embed-template.js");974 975 976 977 978 979 980 981 982 983 984 985 987 if ( SCRIPT_DEBUG ) { 988 readfile( ABSPATH . WPINC . '/js/wp-embed-template.js' ); 989 } else { 990 /* 991 * If you're looking at a src version of this file, you'll see an "include" 992 * statement below. This is used by the `grunt build` process to directly 993 * include a minified version of wp-embed-template.js, instead of using the 994 * readfile() method from above. 995 * 996 * If you're looking at a build version of this file, you'll see a string of 997 * minified JavaScript. If you need to debug it, please turn on SCRIPT_DEBUG 998 * and edit wp-embed-template.js directly. 999 */ 1000 ?> 986 1001 include "js/wp-embed-template.min.js" 987 988 1002 <?php 1003 } 989 1004 ?> 990 1005 </script> -
trunk/tests/phpunit/tests/oembed/controller.php
r44154 r44155 13 13 protected static $administrator; 14 14 protected static $subscriber; 15 const YOUTUBE_VIDEO_ID = 'OQSNhk5ICTI';16 const INVALID_OEMBED_URL = 'https://www.notreallyanoembedprovider.com/watch?v=awesome-cat-video';15 const YOUTUBE_VIDEO_ID = 'OQSNhk5ICTI'; 16 const INVALID_OEMBED_URL = 'https://www.notreallyanoembedprovider.com/watch?v=awesome-cat-video'; 17 17 const UNTRUSTED_PROVIDER_URL = 'https://www.untrustedprovider.com'; 18 18 … … 138 138 'body' => wp_json_encode( 139 139 array( 140 'version' 141 'type' 142 'provider_name' 143 'provider_url' 144 'html' 145 'author_name' 146 'title' 140 'version' => '1.0', 141 'type' => 'rich', 142 'provider_name' => 'Untrusted', 143 'provider_url' => self::UNTRUSTED_PROVIDER_URL, 144 'html' => '<b>Filtered</b><a href="">Unfiltered</a>', 145 'author_name' => 'Untrusted Embed Author', 146 'title' => 'Untrusted Embed', 147 147 ) 148 148 ), … … 652 652 wp_set_current_user( self::$editor ); 653 653 654 $user = self::factory()->user->create_and_get( array( 655 'display_name' => 'John Doe', 656 ) ); 657 $post = self::factory()->post->create_and_get( array( 658 'post_author' => $user->ID, 659 'post_title' => 'Hello World', 660 ) ); 654 $user = self::factory()->user->create_and_get( 655 array( 656 'display_name' => 'John Doe', 657 ) 658 ); 659 $post = self::factory()->post->create_and_get( 660 array( 661 'post_author' => $user->ID, 662 'post_title' => 'Hello World', 663 ) 664 ); 661 665 662 666 $request = new WP_REST_Request( 'GET', '/oembed/1.0/proxy' ); … … 696 700 wp_set_current_user( self::$editor ); 697 701 698 $post = self::factory()->post->create_and_get( array( 699 'post_title' => 'Front page', 700 'post_type' => 'page', 701 'post_author' => 0, 702 ) ); 702 $post = self::factory()->post->create_and_get( 703 array( 704 'post_title' => 'Front page', 705 'post_type' => 'page', 706 'post_author' => 0, 707 ) 708 ); 703 709 704 710 update_option( 'show_on_front', 'page' );
Note: See TracChangeset
for help on using the changeset viewer.