mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 17:18:32 +01:00
Embeds: Fix inclusion of wp-embed-template
script and style when SCRIPT_DEBUG
is disabled.
Amends [52132]. See #44632. Built from https://develop.svn.wordpress.org/trunk@52151 git-svn-id: http://core.svn.wordpress.org/trunk@51743 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
ad3ad59c4d
commit
b665eab47e
@ -472,7 +472,7 @@ function get_post_embed_html( $width, $height, $post = null ) {
|
|||||||
$embed_url .= "#?secret={$secret}";
|
$embed_url .= "#?secret={$secret}";
|
||||||
|
|
||||||
$output = wp_get_inline_script_tag(
|
$output = wp_get_inline_script_tag(
|
||||||
file_get_contents( sprintf( ABSPATH . WPINC . '/js/wp-embed' . wp_scripts_get_suffix() . '.js' ) )
|
file_get_contents( ABSPATH . WPINC . '/js/wp-embed' . wp_scripts_get_suffix() . '.js' )
|
||||||
);
|
);
|
||||||
|
|
||||||
$output .= sprintf(
|
$output .= sprintf(
|
||||||
@ -1042,27 +1042,10 @@ function enqueue_embed_scripts() {
|
|||||||
*/
|
*/
|
||||||
function print_embed_styles() {
|
function print_embed_styles() {
|
||||||
$type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"';
|
$type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"';
|
||||||
|
$suffix = SCRIPT_DEBUG ? '' : '.min';
|
||||||
?>
|
?>
|
||||||
<style<?php echo $type_attr; ?>>
|
<style<?php echo $type_attr; ?>>
|
||||||
<?php
|
<?php echo file_get_contents( ABSPATH . WPINC . "/css/wp-embed-template$suffix.css" ); ?>
|
||||||
if ( SCRIPT_DEBUG ) {
|
|
||||||
readfile( ABSPATH . WPINC . '/css/wp-embed-template.css' );
|
|
||||||
} else {
|
|
||||||
/*
|
|
||||||
* If you're looking at a src version of this file, you'll see an "include"
|
|
||||||
* statement below. This is used by the `npm run build` process to directly
|
|
||||||
* include a minified version of wp-oembed-embed.css, instead of using the
|
|
||||||
* readfile() method from above.
|
|
||||||
*
|
|
||||||
* If you're looking at a build version of this file, you'll see a string of
|
|
||||||
* minified CSS. If you need to debug it, please turn on SCRIPT_DEBUG
|
|
||||||
* and edit wp-embed-template.css directly.
|
|
||||||
*/
|
|
||||||
?>
|
|
||||||
include "css/wp-embed-template.min.css"
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</style>
|
</style>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
@ -1073,30 +1056,9 @@ function print_embed_styles() {
|
|||||||
* @since 4.4.0
|
* @since 4.4.0
|
||||||
*/
|
*/
|
||||||
function print_embed_scripts() {
|
function print_embed_scripts() {
|
||||||
$type_attr = current_theme_supports( 'html5', 'script' ) ? '' : ' type="text/javascript"';
|
wp_print_inline_script_tag(
|
||||||
?>
|
file_get_contents( ABSPATH . WPINC . '/js/wp-embed-template' . wp_scripts_get_suffix() . '.js' )
|
||||||
<script<?php echo $type_attr; ?>>
|
);
|
||||||
<?php
|
|
||||||
if ( SCRIPT_DEBUG ) {
|
|
||||||
readfile( ABSPATH . WPINC . '/js/wp-embed-template.js' );
|
|
||||||
} else {
|
|
||||||
/*
|
|
||||||
* If you're looking at a src version of this file, you'll see an "include"
|
|
||||||
* statement below. This is used by the `npm run build` process to directly
|
|
||||||
* include a minified version of wp-embed-template.js, instead of using the
|
|
||||||
* readfile() method from above.
|
|
||||||
*
|
|
||||||
* If you're looking at a build version of this file, you'll see a string of
|
|
||||||
* minified JavaScript. If you need to debug it, please turn on SCRIPT_DEBUG
|
|
||||||
* and edit wp-embed-template.js directly.
|
|
||||||
*/
|
|
||||||
?>
|
|
||||||
include "js/wp-embed-template.min.js"
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</script>
|
|
||||||
<?php
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.9-alpha-52150';
|
$wp_version = '5.9-alpha-52151';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user