wp/wp-includes/embed.php
changeset 9 177826044cd9
parent 7 cf61fcea0001
child 16 a86126ab1dd4
equal deleted inserted replaced
8:c7c34916027a 9:177826044cd9
    59  * @param string $url Optional. The URL that should be embedded. Default empty.
    59  * @param string $url Optional. The URL that should be embedded. Default empty.
    60  *
    60  *
    61  * @return array Default embed parameters.
    61  * @return array Default embed parameters.
    62  */
    62  */
    63 function wp_embed_defaults( $url = '' ) {
    63 function wp_embed_defaults( $url = '' ) {
    64 	if ( ! empty( $GLOBALS['content_width'] ) )
    64 	if ( ! empty( $GLOBALS['content_width'] ) ) {
    65 		$width = (int) $GLOBALS['content_width'];
    65 		$width = (int) $GLOBALS['content_width'];
    66 
    66 	}
    67 	if ( empty( $width ) )
    67 
       
    68 	if ( empty( $width ) ) {
    68 		$width = 500;
    69 		$width = 500;
       
    70 	}
    69 
    71 
    70 	$height = min( ceil( $width * 1.5 ), 1000 );
    72 	$height = min( ceil( $width * 1.5 ), 1000 );
    71 
    73 
    72 	/**
    74 	/**
    73 	 * Filters the default array of embed dimensions.
    75 	 * Filters the default array of embed dimensions.
   129  * @param string  $provider The URL to the oEmbed provider.
   131  * @param string  $provider The URL to the oEmbed provider.
   130  * @param boolean $regex    Optional. Whether the `$format` parameter is in a RegEx format. Default false.
   132  * @param boolean $regex    Optional. Whether the `$format` parameter is in a RegEx format. Default false.
   131  */
   133  */
   132 function wp_oembed_add_provider( $format, $provider, $regex = false ) {
   134 function wp_oembed_add_provider( $format, $provider, $regex = false ) {
   133 	if ( did_action( 'plugins_loaded' ) ) {
   135 	if ( did_action( 'plugins_loaded' ) ) {
   134 		$oembed = _wp_oembed_get_object();
   136 		$oembed                       = _wp_oembed_get_object();
   135 		$oembed->providers[$format] = array( $provider, $regex );
   137 		$oembed->providers[ $format ] = array( $provider, $regex );
   136 	} else {
   138 	} else {
   137 		WP_oEmbed::_add_provider_early( $format, $provider, $regex );
   139 		WP_oEmbed::_add_provider_early( $format, $provider, $regex );
   138 	}
   140 	}
   139 }
   141 }
   140 
   142 
   224  * @param array  $rawattr The original unmodified attributes.
   226  * @param array  $rawattr The original unmodified attributes.
   225  * @return string The embed HTML.
   227  * @return string The embed HTML.
   226  */
   228  */
   227 function wp_embed_handler_youtube( $matches, $attr, $url, $rawattr ) {
   229 function wp_embed_handler_youtube( $matches, $attr, $url, $rawattr ) {
   228 	global $wp_embed;
   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 	/**
   232 	 * Filters the YoutTube embed output.
   234 	 * Filters the YoutTube embed output.
   233 	 *
   235 	 *
   234 	 * @since 4.0.0
   236 	 * @since 4.0.0
   393  */
   395  */
   394 function get_oembed_endpoint_url( $permalink = '', $format = 'json' ) {
   396 function get_oembed_endpoint_url( $permalink = '', $format = 'json' ) {
   395 	$url = rest_url( 'oembed/1.0/embed' );
   397 	$url = rest_url( 'oembed/1.0/embed' );
   396 
   398 
   397 	if ( '' !== $permalink ) {
   399 	if ( '' !== $permalink ) {
   398 		$url = add_query_arg( array(
   400 		$url = add_query_arg(
   399 			'url'    => urlencode( $permalink ),
   401 			array(
   400 			'format' => ( 'json' !== $format ) ? $format : false,
   402 				'url'    => urlencode( $permalink ),
   401 		), $url );
   403 				'format' => ( 'json' !== $format ) ? $format : false,
       
   404 			),
       
   405 			$url
       
   406 		);
   402 	}
   407 	}
   403 
   408 
   404 	/**
   409 	/**
   405 	 * Filters the oEmbed endpoint URL.
   410 	 * Filters the oEmbed endpoint URL.
   406 	 *
   411 	 *
   447 		 *
   452 		 *
   448 		 * If you're looking at a build version of this file, you'll see a string of
   453 		 * If you're looking at a build version of this file, you'll see a string of
   449 		 * minified JavaScript. If you need to debug it, please turn on SCRIPT_DEBUG
   454 		 * minified JavaScript. If you need to debug it, please turn on SCRIPT_DEBUG
   450 		 * and edit wp-embed.js directly.
   455 		 * and edit wp-embed.js directly.
   451 		 */
   456 		 */
   452 		$output .=<<<JS
   457 		$output .= <<<JS
   453 		!function(a,b){"use strict";function c(){if(!e){e=!0;var a,c,d,f,g=-1!==navigator.appVersion.indexOf("MSIE 10"),h=!!navigator.userAgent.match(/Trident.*rv:11\./),i=b.querySelectorAll("iframe.wp-embedded-content");for(c=0;c<i.length;c++){if(d=i[c],!d.getAttribute("data-secret"))f=Math.random().toString(36).substr(2,10),d.src+="#?secret="+f,d.setAttribute("data-secret",f);if(g||h)a=d.cloneNode(!0),a.removeAttribute("security"),d.parentNode.replaceChild(a,d)}}}var d=!1,e=!1;if(b.querySelector)if(a.addEventListener)d=!0;if(a.wp=a.wp||{},!a.wp.receiveEmbedMessage)if(a.wp.receiveEmbedMessage=function(c){var d=c.data;if(d.secret||d.message||d.value)if(!/[^a-zA-Z0-9]/.test(d.secret)){var e,f,g,h,i,j=b.querySelectorAll('iframe[data-secret="'+d.secret+'"]'),k=b.querySelectorAll('blockquote[data-secret="'+d.secret+'"]');for(e=0;e<k.length;e++)k[e].style.display="none";for(e=0;e<j.length;e++)if(f=j[e],c.source===f.contentWindow){if(f.removeAttribute("style"),"height"===d.message){if(g=parseInt(d.value,10),g>1e3)g=1e3;else if(~~g<200)g=200;f.height=g}if("link"===d.message)if(h=b.createElement("a"),i=b.createElement("a"),h.href=f.getAttribute("src"),i.href=d.value,i.host===h.host)if(b.activeElement===f)a.top.location.href=d.value}else;}},d)a.addEventListener("message",a.wp.receiveEmbedMessage,!1),b.addEventListener("DOMContentLoaded",c,!1),a.addEventListener("load",c,!1)}(window,document);
   458 		!function(a,b){"use strict";function c(){if(!e){e=!0;var a,c,d,f,g=-1!==navigator.appVersion.indexOf("MSIE 10"),h=!!navigator.userAgent.match(/Trident.*rv:11\./),i=b.querySelectorAll("iframe.wp-embedded-content");for(c=0;c<i.length;c++){if(d=i[c],!d.getAttribute("data-secret"))f=Math.random().toString(36).substr(2,10),d.src+="#?secret="+f,d.setAttribute("data-secret",f);if(g||h)a=d.cloneNode(!0),a.removeAttribute("security"),d.parentNode.replaceChild(a,d)}}}var d=!1,e=!1;if(b.querySelector)if(a.addEventListener)d=!0;if(a.wp=a.wp||{},!a.wp.receiveEmbedMessage)if(a.wp.receiveEmbedMessage=function(c){var d=c.data;if(d)if(d.secret||d.message||d.value)if(!/[^a-zA-Z0-9]/.test(d.secret)){var e,f,g,h,i,j=b.querySelectorAll('iframe[data-secret="'+d.secret+'"]'),k=b.querySelectorAll('blockquote[data-secret="'+d.secret+'"]');for(e=0;e<k.length;e++)k[e].style.display="none";for(e=0;e<j.length;e++)if(f=j[e],c.source===f.contentWindow){if(f.removeAttribute("style"),"height"===d.message){if(g=parseInt(d.value,10),g>1e3)g=1e3;else if(~~g<200)g=200;f.height=g}if("link"===d.message)if(h=b.createElement("a"),i=b.createElement("a"),h.href=f.getAttribute("src"),i.href=d.value,i.host===h.host)if(b.activeElement===f)a.top.location.href=d.value}else;}},d)a.addEventListener("message",a.wp.receiveEmbedMessage,!1),b.addEventListener("DOMContentLoaded",c,!1),a.addEventListener("load",c,!1)}(window,document);
   454 JS;
   459 JS;
   455 	}
   460 	}
   456 	$output .= "\n//--><!]]>";
   461 	$output .= "\n//--><!]]>";
   457 	$output .= "\n</script>";
   462 	$output .= "\n</script>";
   458 
   463 
   515 	 *
   520 	 *
   516 	 *     @type int $min Minimum width. Default 200.
   521 	 *     @type int $min Minimum width. Default 200.
   517 	 *     @type int $max Maximum width. Default 600.
   522 	 *     @type int $max Maximum width. Default 600.
   518 	 * }
   523 	 * }
   519 	 */
   524 	 */
   520 	$min_max_width = apply_filters( 'oembed_min_max_width', array(
   525 	$min_max_width = apply_filters(
   521 		'min' => 200,
   526 		'oembed_min_max_width',
   522 		'max' => 600
   527 		array(
   523 	) );
   528 			'min' => 200,
       
   529 			'max' => 600,
       
   530 		)
       
   531 	);
   524 
   532 
   525 	$width  = min( max( $min_max_width['min'], $width ), $min_max_width['max'] );
   533 	$width  = min( max( $min_max_width['min'], $width ), $min_max_width['max'] );
   526 	$height = max( ceil( $width / 16 * 9 ), 200 );
   534 	$height = max( ceil( $width / 16 * 9 ), 200 );
   527 
   535 
   528 	$data = array(
   536 	$data = array(
   529 		'version'       => '1.0',
   537 		'version'       => '1.0',
   530 		'provider_name' => get_bloginfo( 'name' ),
   538 		'provider_name' => get_bloginfo( 'name' ),
   531 		'provider_url'  => get_home_url(),
   539 		'provider_url'  => get_home_url(),
   532 		'author_name'   => get_bloginfo( 'name' ),
   540 		'author_name'   => get_bloginfo( 'name' ),
   533 		'author_url'    => get_home_url(),
   541 		'author_url'    => get_home_url(),
   534 		'title'         => $post->post_title,
   542 		'title'         => get_the_title( $post ),
   535 		'type'          => 'link',
   543 		'type'          => 'link',
   536 	);
   544 	);
   537 
   545 
   538 	$author = get_userdata( $post->post_author );
   546 	$author = get_userdata( $post->post_author );
   539 
   547 
   552 	 * @param int     $width  The requested width.
   560 	 * @param int     $width  The requested width.
   553 	 * @param int     $height The calculated height.
   561 	 * @param int     $height The calculated height.
   554 	 */
   562 	 */
   555 	return apply_filters( 'oembed_response_data', $data, $post, $width, $height );
   563 	return apply_filters( 'oembed_response_data', $data, $post, $width, $height );
   556 }
   564 }
       
   565 
       
   566 
       
   567 /**
       
   568  * Retrieves the oEmbed response data for a given URL.
       
   569  *
       
   570  * @since 5.0.0
       
   571  *
       
   572  * @param string $url  The URL that should be inspected for discovery `<link>` tags.
       
   573  * @param array  $args oEmbed remote get arguments.
       
   574  * @return object|false oEmbed response data if the URL does belong to the current site. False otherwise.
       
   575  */
       
   576 function get_oembed_response_data_for_url( $url, $args ) {
       
   577 	$switched_blog = false;
       
   578 
       
   579 	if ( is_multisite() ) {
       
   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'],
       
   590 			'path'                   => '/',
       
   591 			'update_site_meta_cache' => false,
       
   592 		);
       
   593 
       
   594 		// In case of subdirectory configs, set the path.
       
   595 		if ( ! is_subdomain_install() ) {
       
   596 			$path = explode( '/', ltrim( $url_parts['path'], '/' ) );
       
   597 			$path = reset( $path );
       
   598 
       
   599 			if ( $path ) {
       
   600 				$qv['path'] = get_network()->path . $path . '/';
       
   601 			}
       
   602 		}
       
   603 
       
   604 		$sites = get_sites( $qv );
       
   605 		$site  = reset( $sites );
       
   606 
       
   607 		if ( $site && (int) $site->blog_id !== get_current_blog_id() ) {
       
   608 			switch_to_blog( $site->blog_id );
       
   609 			$switched_blog = true;
       
   610 		}
       
   611 	}
       
   612 
       
   613 	$post_id = url_to_postid( $url );
       
   614 
       
   615 	/** This filter is documented in wp-includes/class-wp-oembed-controller.php */
       
   616 	$post_id = apply_filters( 'oembed_request_post_id', $post_id, $url );
       
   617 
       
   618 	if ( ! $post_id ) {
       
   619 		if ( $switched_blog ) {
       
   620 			restore_current_blog();
       
   621 		}
       
   622 
       
   623 		return false;
       
   624 	}
       
   625 
       
   626 	$width = isset( $args['width'] ) ? $args['width'] : 0;
       
   627 
       
   628 	$data = get_oembed_response_data( $post_id, $width );
       
   629 
       
   630 	if ( $switched_blog ) {
       
   631 		restore_current_blog();
       
   632 	}
       
   633 
       
   634 	return $data ? (object) $data : false;
       
   635 }
       
   636 
   557 
   637 
   558 /**
   638 /**
   559  * Filters the oEmbed response data to return an iframe embed code.
   639  * Filters the oEmbed response data to return an iframe embed code.
   560  *
   640  *
   561  * @since 4.4.0
   641  * @since 4.4.0
   580 	}
   660 	}
   581 
   661 
   582 	if ( 'attachment' === get_post_type( $post ) ) {
   662 	if ( 'attachment' === get_post_type( $post ) ) {
   583 		if ( wp_attachment_is_image( $post ) ) {
   663 		if ( wp_attachment_is_image( $post ) ) {
   584 			$thumbnail_id = $post->ID;
   664 			$thumbnail_id = $post->ID;
   585 		} else if ( wp_attachment_is( 'video', $post ) ) {
   665 		} elseif ( wp_attachment_is( 'video', $post ) ) {
   586 			$thumbnail_id = get_post_thumbnail_id( $post );
   666 			$thumbnail_id = get_post_thumbnail_id( $post );
   587 			$data['type'] = 'video';
   667 			$data['type'] = 'video';
   588 		}
   668 		}
   589 	}
   669 	}
   590 
   670 
   591 	if ( $thumbnail_id ) {
   671 	if ( $thumbnail_id ) {
   592 		list( $thumbnail_url, $thumbnail_width, $thumbnail_height ) = wp_get_attachment_image_src( $thumbnail_id, array( $width, 99999 ) );
   672 		list( $thumbnail_url, $thumbnail_width, $thumbnail_height ) = wp_get_attachment_image_src( $thumbnail_id, array( $width, 99999 ) );
   593 		$data['thumbnail_url']    = $thumbnail_url;
   673 		$data['thumbnail_url']                                      = $thumbnail_url;
   594 		$data['thumbnail_width']  = $thumbnail_width;
   674 		$data['thumbnail_width']                                    = $thumbnail_width;
   595 		$data['thumbnail_height'] = $thumbnail_height;
   675 		$data['thumbnail_height']                                   = $thumbnail_height;
   596 	}
   676 	}
   597 
   677 
   598 	return $data;
   678 	return $data;
   599 }
   679 }
   600 
   680 
   699 
   779 
   700 	return $node->asXML();
   780 	return $node->asXML();
   701 }
   781 }
   702 
   782 
   703 /**
   783 /**
       
   784  * Filters the given oEmbed HTML to make sure iframes have a title attribute.
       
   785  *
       
   786  * @since 5.2.0
       
   787  *
       
   788  * @param string $result The oEmbed HTML result.
       
   789  * @param object $data   A data object result from an oEmbed provider.
       
   790  * @param string $url    The URL of the content to be embedded.
       
   791  * @return string The filtered oEmbed result.
       
   792  */
       
   793 function wp_filter_oembed_iframe_title_attribute( $result, $data, $url ) {
       
   794 	if ( false === $result || ! in_array( $data->type, array( 'rich', 'video' ) ) ) {
       
   795 		return $result;
       
   796 	}
       
   797 
       
   798 	$title = ! empty( $data->title ) ? $data->title : '';
       
   799 
       
   800 	$pattern        = '`<iframe[^>]*?title=(\\\\\'|\\\\"|[\'"])([^>]*?)\1`i';
       
   801 	$has_title_attr = preg_match( $pattern, $result, $matches );
       
   802 
       
   803 	if ( $has_title_attr && ! empty( $matches[2] ) ) {
       
   804 		$title = $matches[2];
       
   805 	}
       
   806 
       
   807 	/**
       
   808 	 * Filters the title attribute of the given oEmbed HTML iframe.
       
   809 	 *
       
   810 	 * @since 5.2.0
       
   811 	 *
       
   812 	 * @param string $title  The title attribute.
       
   813 	 * @param string $result The oEmbed HTML result.
       
   814 	 * @param object $data   A data object result from an oEmbed provider.
       
   815 	 * @param string $url    The URL of the content to be embedded.
       
   816 	 */
       
   817 	$title = apply_filters( 'oembed_iframe_title_attribute', $title, $result, $data, $url );
       
   818 
       
   819 	if ( '' === $title ) {
       
   820 		return $result;
       
   821 	}
       
   822 
       
   823 	if ( $has_title_attr ) {
       
   824 		// Remove the old title, $matches[1]: quote, $matches[2]: title attribute value.
       
   825 		$result = str_replace( ' title=' . $matches[1] . $matches[2] . $matches[1], '', $result );
       
   826 	}
       
   827 
       
   828 	return str_ireplace( '<iframe ', sprintf( '<iframe title="%s" ', esc_attr( $title ) ), $result );
       
   829 }
       
   830 
       
   831 
       
   832 /**
   704  * Filters the given oEmbed HTML.
   833  * Filters the given oEmbed HTML.
   705  *
   834  *
   706  * If the `$url` isn't on the trusted providers list,
   835  * If the `$url` isn't on the trusted providers list,
   707  * we need to filter the HTML heavily for security.
   836  * we need to filter the HTML heavily for security.
   708  *
   837  *
   709  * Only filters 'rich' and 'html' response types.
   838  * Only filters 'rich' and 'video' response types.
   710  *
   839  *
   711  * @since 4.4.0
   840  * @since 4.4.0
   712  *
   841  *
   713  * @param string $result The oEmbed HTML result.
   842  * @param string $result The oEmbed HTML result.
   714  * @param object $data   A data object result from an oEmbed provider.
   843  * @param object $data   A data object result from an oEmbed provider.
   727 		return $result;
   856 		return $result;
   728 	}
   857 	}
   729 
   858 
   730 	$allowed_html = array(
   859 	$allowed_html = array(
   731 		'a'          => array(
   860 		'a'          => array(
   732 			'href'         => true,
   861 			'href' => true,
   733 		),
   862 		),
   734 		'blockquote' => array(),
   863 		'blockquote' => array(),
   735 		'iframe'     => array(
   864 		'iframe'     => array(
   736 			'src'          => true,
   865 			'src'          => true,
   737 			'width'        => true,
   866 			'width'        => true,
   757 
   886 
   758 	if ( ! empty( $results ) ) {
   887 	if ( ! empty( $results ) ) {
   759 		$secret = wp_generate_password( 10, false );
   888 		$secret = wp_generate_password( 10, false );
   760 
   889 
   761 		$url = esc_url( "{$results[2]}#?secret=$secret" );
   890 		$url = esc_url( "{$results[2]}#?secret=$secret" );
   762 		$q = $results[1];
   891 		$q   = $results[1];
   763 
   892 
   764 		$html = str_replace( $results[0], ' src=' . $q . $url . $q . ' data-secret=' . $q . $secret . $q, $html );
   893 		$html = str_replace( $results[0], ' src=' . $q . $url . $q . ' data-secret=' . $q . $secret . $q, $html );
   765 		$html = str_replace( '<blockquote', "<blockquote data-secret=\"$secret\"", $html );
   894 		$html = str_replace( '<blockquote', "<blockquote data-secret=\"$secret\"", $html );
   766 	}
   895 	}
   767 
   896 
   768 	$allowed_html['blockquote']['data-secret'] = true;
   897 	$allowed_html['blockquote']['data-secret'] = true;
   769 	$allowed_html['iframe']['data-secret'] = true;
   898 	$allowed_html['iframe']['data-secret']     = true;
   770 
   899 
   771 	$html = wp_kses( $html, $allowed_html );
   900 	$html = wp_kses( $html, $allowed_html );
   772 
   901 
   773 	if ( ! empty( $content[1] ) ) {
   902 	if ( ! empty( $content[1] ) ) {
   774 		// We have a blockquote to fall back on. Hide the iframe by default.
   903 		// We have a blockquote to fall back on. Hide the iframe by default.
   795 function wp_embed_excerpt_more( $more_string ) {
   924 function wp_embed_excerpt_more( $more_string ) {
   796 	if ( ! is_embed() ) {
   925 	if ( ! is_embed() ) {
   797 		return $more_string;
   926 		return $more_string;
   798 	}
   927 	}
   799 
   928 
   800 	$link = sprintf( '<a href="%1$s" class="wp-embed-more" target="_top">%2$s</a>',
   929 	$link = sprintf(
       
   930 		'<a href="%1$s" class="wp-embed-more" target="_top">%2$s</a>',
   801 		esc_url( get_permalink() ),
   931 		esc_url( get_permalink() ),
   802 		/* translators: %s: Name of current post */
   932 		/* translators: %s: Name of current post */
   803 		sprintf( __( 'Continue reading %s' ), '<span class="screen-reader-text">' . get_the_title() . '</span>' )
   933 		sprintf( __( 'Continue reading %s' ), '<span class="screen-reader-text">' . get_the_title() . '</span>' )
   804 	);
   934 	);
   805 	return ' &hellip; ' . $link;
   935 	return ' &hellip; ' . $link;
   871  */
  1001  */
   872 function print_embed_styles() {
  1002 function print_embed_styles() {
   873 	?>
  1003 	?>
   874 	<style type="text/css">
  1004 	<style type="text/css">
   875 	<?php
  1005 	<?php
   876 		if ( SCRIPT_DEBUG ) {
  1006 	if ( SCRIPT_DEBUG ) {
   877 			readfile( ABSPATH . WPINC . "/css/wp-embed-template.css" );
  1007 		readfile( ABSPATH . WPINC . '/css/wp-embed-template.css' );
   878 		} else {
  1008 	} else {
   879 			/*
  1009 		/*
   880 			 * If you're looking at a src version of this file, you'll see an "include"
  1010 		 * If you're looking at a src version of this file, you'll see an "include"
   881 			 * statement below. This is used by the `grunt build` process to directly
  1011 		 * statement below. This is used by the `grunt build` process to directly
   882 			 * include a minified version of wp-oembed-embed.css, instead of using the
  1012 		 * include a minified version of wp-oembed-embed.css, instead of using the
   883 			 * readfile() method from above.
  1013 		 * readfile() method from above.
   884 			 *
  1014 		 *
   885 			 * If you're looking at a build version of this file, you'll see a string of
  1015 		 * If you're looking at a build version of this file, you'll see a string of
   886 			 * minified CSS. If you need to debug it, please turn on SCRIPT_DEBUG
  1016 		 * minified CSS. If you need to debug it, please turn on SCRIPT_DEBUG
   887 			 * and edit wp-embed-template.css directly.
  1017 		 * and edit wp-embed-template.css directly.
   888 			 */
  1018 		 */
   889 			?>
  1019 		?>
   890 			body,html{padding:0;margin:0}body{font-family:sans-serif}.wp-embed,.wp-embed-share-input{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif}.screen-reader-text{border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-wrap:normal!important}.dashicons{display:inline-block;width:20px;height:20px;background-color:transparent;background-repeat:no-repeat;background-size:20px;background-position:center;transition:background .1s ease-in;position:relative;top:5px}.dashicons-no{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M15.55%2013.7l-2.19%202.06-3.42-3.65-3.64%203.43-2.06-2.18%203.64-3.43-3.42-3.64%202.18-2.06%203.43%203.64%203.64-3.42%202.05%202.18-3.64%203.43z%27%20fill%3D%27%23fff%27%2F%3E%3C%2Fsvg%3E")}.dashicons-admin-comments{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M5%202h9q.82%200%201.41.59T16%204v7q0%20.82-.59%201.41T14%2013h-2l-5%205v-5H5q-.82%200-1.41-.59T3%2011V4q0-.82.59-1.41T5%202z%27%20fill%3D%27%2382878c%27%2F%3E%3C%2Fsvg%3E")}.wp-embed-comments a:hover .dashicons-admin-comments{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M5%202h9q.82%200%201.41.59T16%204v7q0%20.82-.59%201.41T14%2013h-2l-5%205v-5H5q-.82%200-1.41-.59T3%2011V4q0-.82.59-1.41T5%202z%27%20fill%3D%27%230073aa%27%2F%3E%3C%2Fsvg%3E")}.dashicons-share{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M14.5%2012q1.24%200%202.12.88T17.5%2015t-.88%202.12-2.12.88-2.12-.88T11.5%2015q0-.34.09-.69l-4.38-2.3Q6.32%2013%205%2013q-1.24%200-2.12-.88T2%2010t.88-2.12T5%207q1.3%200%202.21.99l4.38-2.3q-.09-.35-.09-.69%200-1.24.88-2.12T14.5%202t2.12.88T17.5%205t-.88%202.12T14.5%208q-1.3%200-2.21-.99l-4.38%202.3Q8%209.66%208%2010t-.09.69l4.38%202.3q.89-.99%202.21-.99z%27%20fill%3D%27%2382878c%27%2F%3E%3C%2Fsvg%3E");display:none}.js .dashicons-share{display:inline-block}.wp-embed-share-dialog-open:hover .dashicons-share{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M14.5%2012q1.24%200%202.12.88T17.5%2015t-.88%202.12-2.12.88-2.12-.88T11.5%2015q0-.34.09-.69l-4.38-2.3Q6.32%2013%205%2013q-1.24%200-2.12-.88T2%2010t.88-2.12T5%207q1.3%200%202.21.99l4.38-2.3q-.09-.35-.09-.69%200-1.24.88-2.12T14.5%202t2.12.88T17.5%205t-.88%202.12T14.5%208q-1.3%200-2.21-.99l-4.38%202.3Q8%209.66%208%2010t-.09.69l4.38%202.3q.89-.99%202.21-.99z%27%20fill%3D%27%230073aa%27%2F%3E%3C%2Fsvg%3E")}.wp-embed{padding:25px;font-size:14px;font-weight:400;line-height:1.5;color:#82878c;background:#fff;border:1px solid #e5e5e5;box-shadow:0 1px 1px rgba(0,0,0,.05);overflow:auto;zoom:1}.wp-embed a{color:#82878c;text-decoration:none}.wp-embed a:hover{text-decoration:underline}.wp-embed-featured-image{margin-bottom:20px}.wp-embed-featured-image img{width:100%;height:auto;border:none}.wp-embed-featured-image.square{float:left;max-width:160px;margin-right:20px}.wp-embed p{margin:0}p.wp-embed-heading{margin:0 0 15px;font-weight:600;font-size:22px;line-height:1.3}.wp-embed-heading a{color:#32373c}.wp-embed .wp-embed-more{color:#b4b9be}.wp-embed-footer{display:table;width:100%;margin-top:30px}.wp-embed-site-icon{position:absolute;top:50%;left:0;-webkit-transform:translateY(-50%);transform:translateY(-50%);height:25px;width:25px;border:0}.wp-embed-site-title{font-weight:600;line-height:25px}.wp-embed-site-title a{position:relative;display:inline-block;padding-left:35px}.wp-embed-meta,.wp-embed-site-title{display:table-cell}.wp-embed-meta{text-align:right;white-space:nowrap;vertical-align:middle}.wp-embed-comments,.wp-embed-share{display:inline}.wp-embed-comments a,.wp-embed-share-tab-button{display:inline-block}.wp-embed-meta a:hover{text-decoration:none;color:#0073aa}.wp-embed-comments a{line-height:25px}.wp-embed-comments+.wp-embed-share{margin-left:10px}.wp-embed-share-dialog{position:absolute;top:0;left:0;right:0;bottom:0;background-color:#222;background-color:rgba(10,10,10,.9);color:#fff;opacity:1;transition:opacity .25s ease-in-out}.wp-embed-share-dialog.hidden{opacity:0;visibility:hidden}.wp-embed-share-dialog-close,.wp-embed-share-dialog-open{margin:-8px 0 0;padding:0;background:0 0;border:none;cursor:pointer;outline:0}.wp-embed-share-dialog-close .dashicons,.wp-embed-share-dialog-open .dashicons{padding:4px}.wp-embed-share-dialog-open .dashicons{top:8px}.wp-embed-share-dialog-close:focus .dashicons,.wp-embed-share-dialog-open:focus .dashicons{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8);border-radius:100%}.wp-embed-share-dialog-close{position:absolute;top:20px;right:20px;font-size:22px}.wp-embed-share-dialog-close:hover{text-decoration:none}.wp-embed-share-dialog-close .dashicons{height:24px;width:24px;background-size:24px}.wp-embed-share-dialog-content{height:100%;-webkit-transform-style:preserve-3d;transform-style:preserve-3d;overflow:hidden}.wp-embed-share-dialog-text{margin-top:25px;padding:20px}.wp-embed-share-tabs{margin:0 0 20px;padding:0;list-style:none}.wp-embed-share-tab-button button{margin:0;padding:0;border:none;background:0 0;font-size:16px;line-height:1.3;color:#aaa;cursor:pointer;transition:color .1s ease-in}.wp-embed-share-tab-button [aria-selected=true],.wp-embed-share-tab-button button:hover{color:#fff}.wp-embed-share-tab-button+.wp-embed-share-tab-button{margin:0 0 0 10px;padding:0 0 0 11px;border-left:1px solid #aaa}.wp-embed-share-tab[aria-hidden=true]{display:none}p.wp-embed-share-description{margin:0;font-size:14px;line-height:1;font-style:italic;color:#aaa}.wp-embed-share-input{box-sizing:border-box;width:100%;border:none;height:28px;margin:0 0 10px;padding:0 5px;font-size:14px;font-weight:400;line-height:1.5;resize:none;cursor:text}textarea.wp-embed-share-input{height:72px}html[dir=rtl] .wp-embed-featured-image.square{float:right;margin-right:0;margin-left:20px}html[dir=rtl] .wp-embed-site-title a{padding-left:0;padding-right:35px}html[dir=rtl] .wp-embed-site-icon{margin-right:0;margin-left:10px;left:auto;right:0}html[dir=rtl] .wp-embed-meta{text-align:left}html[dir=rtl] .wp-embed-share{margin-left:0;margin-right:10px}html[dir=rtl] .wp-embed-share-dialog-close{right:auto;left:20px}html[dir=rtl] .wp-embed-share-tab-button+.wp-embed-share-tab-button{margin:0 10px 0 0;padding:0 11px 0 0;border-left:none;border-right:1px solid #aaa}
  1020 			/*! This file is auto-generated */
   891 			<?php
  1021 			body,html{padding:0;margin:0}body{font-family:sans-serif}.screen-reader-text{border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-wrap:normal!important}.dashicons{display:inline-block;width:20px;height:20px;background-color:transparent;background-repeat:no-repeat;background-size:20px;background-position:center;transition:background .1s ease-in;position:relative;top:5px}.dashicons-no{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M15.55%2013.7l-2.19%202.06-3.42-3.65-3.64%203.43-2.06-2.18%203.64-3.43-3.42-3.64%202.18-2.06%203.43%203.64%203.64-3.42%202.05%202.18-3.64%203.43z%27%20fill%3D%27%23fff%27%2F%3E%3C%2Fsvg%3E")}.dashicons-admin-comments{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M5%202h9q.82%200%201.41.59T16%204v7q0%20.82-.59%201.41T14%2013h-2l-5%205v-5H5q-.82%200-1.41-.59T3%2011V4q0-.82.59-1.41T5%202z%27%20fill%3D%27%2382878c%27%2F%3E%3C%2Fsvg%3E")}.wp-embed-comments a:hover .dashicons-admin-comments{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M5%202h9q.82%200%201.41.59T16%204v7q0%20.82-.59%201.41T14%2013h-2l-5%205v-5H5q-.82%200-1.41-.59T3%2011V4q0-.82.59-1.41T5%202z%27%20fill%3D%27%230073aa%27%2F%3E%3C%2Fsvg%3E")}.dashicons-share{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M14.5%2012q1.24%200%202.12.88T17.5%2015t-.88%202.12-2.12.88-2.12-.88T11.5%2015q0-.34.09-.69l-4.38-2.3Q6.32%2013%205%2013q-1.24%200-2.12-.88T2%2010t.88-2.12T5%207q1.3%200%202.21.99l4.38-2.3q-.09-.35-.09-.69%200-1.24.88-2.12T14.5%202t2.12.88T17.5%205t-.88%202.12T14.5%208q-1.3%200-2.21-.99l-4.38%202.3Q8%209.66%208%2010t-.09.69l4.38%202.3q.89-.99%202.21-.99z%27%20fill%3D%27%2382878c%27%2F%3E%3C%2Fsvg%3E");display:none}.js .dashicons-share{display:inline-block}.wp-embed-share-dialog-open:hover .dashicons-share{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M14.5%2012q1.24%200%202.12.88T17.5%2015t-.88%202.12-2.12.88-2.12-.88T11.5%2015q0-.34.09-.69l-4.38-2.3Q6.32%2013%205%2013q-1.24%200-2.12-.88T2%2010t.88-2.12T5%207q1.3%200%202.21.99l4.38-2.3q-.09-.35-.09-.69%200-1.24.88-2.12T14.5%202t2.12.88T17.5%205t-.88%202.12T14.5%208q-1.3%200-2.21-.99l-4.38%202.3Q8%209.66%208%2010t-.09.69l4.38%202.3q.89-.99%202.21-.99z%27%20fill%3D%27%230073aa%27%2F%3E%3C%2Fsvg%3E")}.wp-embed{padding:25px;font-size:14px;font-weight:400;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;line-height:1.5;color:#82878c;background:#fff;border:1px solid #e5e5e5;box-shadow:0 1px 1px rgba(0,0,0,.05);overflow:auto;zoom:1}.wp-embed a{color:#82878c;text-decoration:none}.wp-embed a:hover{text-decoration:underline}.wp-embed-featured-image{margin-bottom:20px}.wp-embed-featured-image img{width:100%;height:auto;border:none}.wp-embed-featured-image.square{float:left;max-width:160px;margin-right:20px}.wp-embed p{margin:0}p.wp-embed-heading{margin:0 0 15px;font-weight:600;font-size:22px;line-height:1.3}.wp-embed-heading a{color:#32373c}.wp-embed .wp-embed-more{color:#b4b9be}.wp-embed-footer{display:table;width:100%;margin-top:30px}.wp-embed-site-icon{position:absolute;top:50%;left:0;transform:translateY(-50%);height:25px;width:25px;border:0}.wp-embed-site-title{font-weight:600;line-height:25px}.wp-embed-site-title a{position:relative;display:inline-block;padding-left:35px}.wp-embed-meta,.wp-embed-site-title{display:table-cell}.wp-embed-meta{text-align:right;white-space:nowrap;vertical-align:middle}.wp-embed-comments,.wp-embed-share{display:inline}.wp-embed-meta a:hover{text-decoration:none;color:#0073aa}.wp-embed-comments a{line-height:25px;display:inline-block}.wp-embed-comments+.wp-embed-share{margin-left:10px}.wp-embed-share-dialog{position:absolute;top:0;left:0;right:0;bottom:0;background-color:#222;background-color:rgba(10,10,10,.9);color:#fff;opacity:1;transition:opacity .25s ease-in-out}.wp-embed-share-dialog.hidden{opacity:0;visibility:hidden}.wp-embed-share-dialog-close,.wp-embed-share-dialog-open{margin:-8px 0 0;padding:0;background:0 0;border:none;cursor:pointer;outline:0}.wp-embed-share-dialog-close .dashicons,.wp-embed-share-dialog-open .dashicons{padding:4px}.wp-embed-share-dialog-open .dashicons{top:8px}.wp-embed-share-dialog-close:focus .dashicons,.wp-embed-share-dialog-open:focus .dashicons{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8);border-radius:100%}.wp-embed-share-dialog-close{position:absolute;top:20px;right:20px;font-size:22px}.wp-embed-share-dialog-close:hover{text-decoration:none}.wp-embed-share-dialog-close .dashicons{height:24px;width:24px;background-size:24px}.wp-embed-share-dialog-content{height:100%;transform-style:preserve-3d;overflow:hidden}.wp-embed-share-dialog-text{margin-top:25px;padding:20px}.wp-embed-share-tabs{margin:0 0 20px;padding:0;list-style:none}.wp-embed-share-tab-button{display:inline-block}.wp-embed-share-tab-button button{margin:0;padding:0;border:none;background:0 0;font-size:16px;line-height:1.3;color:#aaa;cursor:pointer;transition:color .1s ease-in}.wp-embed-share-tab-button [aria-selected=true]{color:#fff}.wp-embed-share-tab-button button:hover{color:#fff}.wp-embed-share-tab-button+.wp-embed-share-tab-button{margin:0 0 0 10px;padding:0 0 0 11px;border-left:1px solid #aaa}.wp-embed-share-tab[aria-hidden=true]{display:none}p.wp-embed-share-description{margin:0;font-size:14px;line-height:1;font-style:italic;color:#aaa}.wp-embed-share-input{box-sizing:border-box;width:100%;border:none;height:28px;margin:0 0 10px 0;padding:0 5px;font-size:14px;font-weight:400;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;line-height:1.5;resize:none;cursor:text}textarea.wp-embed-share-input{height:72px}html[dir=rtl] .wp-embed-featured-image.square{float:right;margin-right:0;margin-left:20px}html[dir=rtl] .wp-embed-site-title a{padding-left:0;padding-right:35px}html[dir=rtl] .wp-embed-site-icon{margin-right:0;margin-left:10px;left:auto;right:0}html[dir=rtl] .wp-embed-meta{text-align:left}html[dir=rtl] .wp-embed-share{margin-left:0;margin-right:10px}html[dir=rtl] .wp-embed-share-dialog-close{right:auto;left:20px}html[dir=rtl] .wp-embed-share-tab-button+.wp-embed-share-tab-button{margin:0 10px 0 0;padding:0 11px 0 0;border-left:none;border-right:1px solid #aaa}
   892 		}
  1022 		<?php
       
  1023 	}
   893 	?>
  1024 	?>
   894 	</style>
  1025 	</style>
   895 	<?php
  1026 	<?php
   896 }
  1027 }
   897 
  1028 
   902  */
  1033  */
   903 function print_embed_scripts() {
  1034 function print_embed_scripts() {
   904 	?>
  1035 	?>
   905 	<script type="text/javascript">
  1036 	<script type="text/javascript">
   906 	<?php
  1037 	<?php
   907 		if ( SCRIPT_DEBUG ) {
  1038 	if ( SCRIPT_DEBUG ) {
   908 			readfile( ABSPATH . WPINC . "/js/wp-embed-template.js" );
  1039 		readfile( ABSPATH . WPINC . '/js/wp-embed-template.js' );
   909 		} else {
  1040 	} else {
   910 			/*
  1041 		/*
   911 			 * If you're looking at a src version of this file, you'll see an "include"
  1042 		 * If you're looking at a src version of this file, you'll see an "include"
   912 			 * statement below. This is used by the `grunt build` process to directly
  1043 		 * statement below. This is used by the `grunt build` process to directly
   913 			 * include a minified version of wp-embed-template.js, instead of using the
  1044 		 * include a minified version of wp-embed-template.js, instead of using the
   914 			 * readfile() method from above.
  1045 		 * readfile() method from above.
   915 			 *
  1046 		 *
   916 			 * If you're looking at a build version of this file, you'll see a string of
  1047 		 * If you're looking at a build version of this file, you'll see a string of
   917 			 * minified JavaScript. If you need to debug it, please turn on SCRIPT_DEBUG
  1048 		 * minified JavaScript. If you need to debug it, please turn on SCRIPT_DEBUG
   918 			 * and edit wp-embed-template.js directly.
  1049 		 * and edit wp-embed-template.js directly.
   919 			 */
  1050 		 */
   920 			?>
  1051 		?>
   921 			!function(a,b){"use strict";function c(b,c){a.parent.postMessage({message:b,value:c,secret:g},"*")}function d(){function d(){l.className=l.className.replace("hidden",""),b.querySelector('.wp-embed-share-tab-button [aria-selected="true"]').focus()}function e(){l.className+=" hidden",b.querySelector(".wp-embed-share-dialog-open").focus()}function f(a){var c=b.querySelector('.wp-embed-share-tab-button [aria-selected="true"]');c.setAttribute("aria-selected","false"),b.querySelector("#"+c.getAttribute("aria-controls")).setAttribute("aria-hidden","true"),a.target.setAttribute("aria-selected","true"),b.querySelector("#"+a.target.getAttribute("aria-controls")).setAttribute("aria-hidden","false")}function g(a){var c,d,e=a.target,f=e.parentElement.previousElementSibling,g=e.parentElement.nextElementSibling;if(37===a.keyCode)c=f;else{if(39!==a.keyCode)return!1;c=g}"rtl"===b.documentElement.getAttribute("dir")&&(c=c===f?g:f),c&&(d=c.firstElementChild,e.setAttribute("tabindex","-1"),e.setAttribute("aria-selected",!1),b.querySelector("#"+e.getAttribute("aria-controls")).setAttribute("aria-hidden","true"),d.setAttribute("tabindex","0"),d.setAttribute("aria-selected","true"),d.focus(),b.querySelector("#"+d.getAttribute("aria-controls")).setAttribute("aria-hidden","false"))}function h(a){var c=b.querySelector('.wp-embed-share-tab-button [aria-selected="true"]');n!==a.target||a.shiftKey?c===a.target&&a.shiftKey&&(n.focus(),a.preventDefault()):(c.focus(),a.preventDefault())}function i(a){var b,d=a.target;b=d.hasAttribute("href")?d.getAttribute("href"):d.parentElement.getAttribute("href"),b&&(c("link",b),a.preventDefault())}if(!k){k=!0;var j,l=b.querySelector(".wp-embed-share-dialog"),m=b.querySelector(".wp-embed-share-dialog-open"),n=b.querySelector(".wp-embed-share-dialog-close"),o=b.querySelectorAll(".wp-embed-share-input"),p=b.querySelectorAll(".wp-embed-share-tab-button button"),q=b.querySelector(".wp-embed-featured-image img");if(o)for(j=0;j<o.length;j++)o[j].addEventListener("click",function(a){a.target.select()});if(m&&m.addEventListener("click",function(){d()}),n&&n.addEventListener("click",function(){e()}),p)for(j=0;j<p.length;j++)p[j].addEventListener("click",f),p[j].addEventListener("keydown",g);b.addEventListener("keydown",function(a){27===a.keyCode&&-1===l.className.indexOf("hidden")?e():9===a.keyCode&&h(a)},!1),a.self!==a.top&&(c("height",Math.ceil(b.body.getBoundingClientRect().height)),q&&q.addEventListener("load",function(){c("height",Math.ceil(b.body.getBoundingClientRect().height))}),b.addEventListener("click",i))}}function e(){a.self!==a.top&&(clearTimeout(i),i=setTimeout(function(){c("height",Math.ceil(b.body.getBoundingClientRect().height))},100))}function f(){a.self===a.top||g||(g=a.location.hash.replace(/.*secret=([\d\w]{10}).*/,"$1"),clearTimeout(h),h=setTimeout(function(){f()},100))}var g,h,i,j=b.querySelector&&a.addEventListener,k=!1;j&&(f(),b.documentElement.className=b.documentElement.className.replace(/\bno-js\b/,"")+" js",b.addEventListener("DOMContentLoaded",d,!1),a.addEventListener("load",d,!1),a.addEventListener("resize",e,!1))}(window,document);
  1052 			!function(a,b){"use strict";function c(b,c){a.parent.postMessage({message:b,value:c,secret:g},"*")}function d(){function d(){l.className=l.className.replace("hidden",""),b.querySelector('.wp-embed-share-tab-button [aria-selected="true"]').focus()}function e(){l.className+=" hidden",b.querySelector(".wp-embed-share-dialog-open").focus()}function f(a){var c=b.querySelector('.wp-embed-share-tab-button [aria-selected="true"]');c.setAttribute("aria-selected","false"),b.querySelector("#"+c.getAttribute("aria-controls")).setAttribute("aria-hidden","true"),a.target.setAttribute("aria-selected","true"),b.querySelector("#"+a.target.getAttribute("aria-controls")).setAttribute("aria-hidden","false")}function g(a){var c,d,e=a.target,f=e.parentElement.previousElementSibling,g=e.parentElement.nextElementSibling;if(37===a.keyCode)c=f;else{if(39!==a.keyCode)return!1;c=g}"rtl"===b.documentElement.getAttribute("dir")&&(c=c===f?g:f),c&&(d=c.firstElementChild,e.setAttribute("tabindex","-1"),e.setAttribute("aria-selected",!1),b.querySelector("#"+e.getAttribute("aria-controls")).setAttribute("aria-hidden","true"),d.setAttribute("tabindex","0"),d.setAttribute("aria-selected","true"),d.focus(),b.querySelector("#"+d.getAttribute("aria-controls")).setAttribute("aria-hidden","false"))}function h(a){var c=b.querySelector('.wp-embed-share-tab-button [aria-selected="true"]');n!==a.target||a.shiftKey?c===a.target&&a.shiftKey&&(n.focus(),a.preventDefault()):(c.focus(),a.preventDefault())}function i(a){var b,d=a.target;b=d.hasAttribute("href")?d.getAttribute("href"):d.parentElement.getAttribute("href"),b&&(c("link",b),a.preventDefault())}if(!k){k=!0;var j,l=b.querySelector(".wp-embed-share-dialog"),m=b.querySelector(".wp-embed-share-dialog-open"),n=b.querySelector(".wp-embed-share-dialog-close"),o=b.querySelectorAll(".wp-embed-share-input"),p=b.querySelectorAll(".wp-embed-share-tab-button button"),q=b.querySelector(".wp-embed-featured-image img");if(o)for(j=0;j<o.length;j++)o[j].addEventListener("click",function(a){a.target.select()});if(m&&m.addEventListener("click",function(){d()}),n&&n.addEventListener("click",function(){e()}),p)for(j=0;j<p.length;j++)p[j].addEventListener("click",f),p[j].addEventListener("keydown",g);b.addEventListener("keydown",function(a){27===a.keyCode&&-1===l.className.indexOf("hidden")?e():9===a.keyCode&&h(a)},!1),a.self!==a.top&&(c("height",Math.ceil(b.body.getBoundingClientRect().height)),q&&q.addEventListener("load",function(){c("height",Math.ceil(b.body.getBoundingClientRect().height))}),b.addEventListener("click",i))}}function e(){a.self!==a.top&&(clearTimeout(i),i=setTimeout(function(){c("height",Math.ceil(b.body.getBoundingClientRect().height))},100))}function f(){a.self===a.top||g||(g=a.location.hash.replace(/.*secret=([\d\w]{10}).*/,"$1"),clearTimeout(h),h=setTimeout(function(){f()},100))}var g,h,i,j=b.querySelector&&a.addEventListener,k=!1;j&&(f(),b.documentElement.className=b.documentElement.className.replace(/\bno-js\b/,"")+" js",b.addEventListener("DOMContentLoaded",d,!1),a.addEventListener("load",d,!1),a.addEventListener("resize",e,!1))}(window,document);
   922 			<?php
  1053 		<?php
   923 		}
  1054 	}
   924 	?>
  1055 	?>
   925 	</script>
  1056 	</script>
   926 	<?php
  1057 	<?php
   927 }
  1058 }
   928 
  1059 
  1069  * @param array       $args   oEmbed remote get arguments.
  1200  * @param array       $args   oEmbed remote get arguments.
  1070  * @return null|string The UNSANITIZED (and potentially unsafe) HTML that should be used to embed.
  1201  * @return null|string The UNSANITIZED (and potentially unsafe) HTML that should be used to embed.
  1071  *                     Null if the URL does not belong to the current site.
  1202  *                     Null if the URL does not belong to the current site.
  1072  */
  1203  */
  1073 function wp_filter_pre_oembed_result( $result, $url, $args ) {
  1204 function wp_filter_pre_oembed_result( $result, $url, $args ) {
  1074 	$switched_blog = false;
  1205 	$data = get_oembed_response_data_for_url( $url, $args );
  1075 
  1206 
  1076 	if ( is_multisite() ) {
  1207 	if ( $data ) {
  1077 		$url_parts = wp_parse_args( wp_parse_url( $url ), array(
  1208 		return _wp_oembed_get_object()->data2html( $data, $url );
  1078 			'host'   => '',
  1209 	}
  1079 			'path'   => '/',
  1210 
  1080 		) );
  1211 	return $result;
  1081 
  1212 }
  1082 		$qv = array( 'domain' => $url_parts['host'], 'path' => '/' );
       
  1083 
       
  1084 		// In case of subdirectory configs, set the path.
       
  1085 		if ( ! is_subdomain_install() ) {
       
  1086 			$path = explode( '/', ltrim( $url_parts['path'], '/' ) );
       
  1087 			$path = reset( $path );
       
  1088 
       
  1089 			if ( $path ) {
       
  1090 				$qv['path'] = get_network()->path . $path . '/';
       
  1091 			}
       
  1092 		}
       
  1093 
       
  1094 		$sites = get_sites( $qv );
       
  1095 		$site  = reset( $sites );
       
  1096 
       
  1097 		if ( $site && (int) $site->blog_id !== get_current_blog_id() ) {
       
  1098 			switch_to_blog( $site->blog_id );
       
  1099 			$switched_blog = true;
       
  1100 		}
       
  1101 	}
       
  1102 
       
  1103 	$post_id = url_to_postid( $url );
       
  1104 
       
  1105 	/** This filter is documented in wp-includes/class-wp-oembed-controller.php */
       
  1106 	$post_id = apply_filters( 'oembed_request_post_id', $post_id, $url );
       
  1107 
       
  1108 	if ( ! $post_id ) {
       
  1109 		if ( $switched_blog ) {
       
  1110 			restore_current_blog();
       
  1111 		}
       
  1112 
       
  1113 		return $result;
       
  1114 	}
       
  1115 
       
  1116 	$width = isset( $args['width'] ) ? $args['width'] : 0;
       
  1117 
       
  1118 	$data = get_oembed_response_data( $post_id, $width );
       
  1119 	$data = _wp_oembed_get_object()->data2html( (object) $data, $url );
       
  1120 
       
  1121 	if ( $switched_blog ) {
       
  1122 		restore_current_blog();
       
  1123 	}
       
  1124 
       
  1125 	if ( ! $data ) {
       
  1126 		return $result;
       
  1127 	}
       
  1128 
       
  1129 	return $data;
       
  1130 }