mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 17:48:01 +01:00
Script Loader: Remove unnecessary reference sign from function definitions in script loader.
This resolves PHP warnings when extensions like `php_uopz` or `php_tideways_xhprof` are in use. Object variables in PHP 5+ contain a reference to the object, and it's the reference that's passed around. Props jqz, killerbishop, Mte90, TJNowell, jorbin, pento, pcarvalho, valentinbora, SergeyBiryukov. Fixes #44979. Built from https://develop.svn.wordpress.org/trunk@47355 git-svn-id: http://core.svn.wordpress.org/trunk@47142 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
f616ffb9c1
commit
556c6d80d8
@ -41,7 +41,7 @@ require ABSPATH . WPINC . '/functions.wp-styles.php';
|
|||||||
*
|
*
|
||||||
* @param WP_Scripts $scripts WP_Scripts object.
|
* @param WP_Scripts $scripts WP_Scripts object.
|
||||||
*/
|
*/
|
||||||
function wp_register_tinymce_scripts( &$scripts, $force_uncompressed = false ) {
|
function wp_register_tinymce_scripts( $scripts, $force_uncompressed = false ) {
|
||||||
global $tinymce_version, $concatenate_scripts, $compress_scripts;
|
global $tinymce_version, $concatenate_scripts, $compress_scripts;
|
||||||
$suffix = wp_scripts_get_suffix();
|
$suffix = wp_scripts_get_suffix();
|
||||||
$dev_suffix = wp_scripts_get_suffix( 'dev' );
|
$dev_suffix = wp_scripts_get_suffix( 'dev' );
|
||||||
@ -73,7 +73,7 @@ function wp_register_tinymce_scripts( &$scripts, $force_uncompressed = false ) {
|
|||||||
*
|
*
|
||||||
* @param WP_Scripts $scripts WP_Scripts object.
|
* @param WP_Scripts $scripts WP_Scripts object.
|
||||||
*/
|
*/
|
||||||
function wp_default_packages_vendor( &$scripts ) {
|
function wp_default_packages_vendor( $scripts ) {
|
||||||
global $wp_locale;
|
global $wp_locale;
|
||||||
|
|
||||||
$suffix = wp_scripts_get_suffix();
|
$suffix = wp_scripts_get_suffix();
|
||||||
@ -176,7 +176,7 @@ function wp_default_packages_vendor( &$scripts ) {
|
|||||||
* @param array $tests Features to detect.
|
* @param array $tests Features to detect.
|
||||||
* @return string Conditional polyfill inline script.
|
* @return string Conditional polyfill inline script.
|
||||||
*/
|
*/
|
||||||
function wp_get_script_polyfill( &$scripts, $tests ) {
|
function wp_get_script_polyfill( $scripts, $tests ) {
|
||||||
$polyfill = '';
|
$polyfill = '';
|
||||||
foreach ( $tests as $test => $handle ) {
|
foreach ( $tests as $test => $handle ) {
|
||||||
if ( ! array_key_exists( $handle, $scripts->registered ) ) {
|
if ( ! array_key_exists( $handle, $scripts->registered ) ) {
|
||||||
@ -228,7 +228,7 @@ function wp_get_script_polyfill( &$scripts, $tests ) {
|
|||||||
*
|
*
|
||||||
* @param WP_Scripts $scripts WP_Scripts object.
|
* @param WP_Scripts $scripts WP_Scripts object.
|
||||||
*/
|
*/
|
||||||
function wp_default_packages_scripts( &$scripts ) {
|
function wp_default_packages_scripts( $scripts ) {
|
||||||
$suffix = wp_scripts_get_suffix();
|
$suffix = wp_scripts_get_suffix();
|
||||||
|
|
||||||
// Expects multidimensional array like:
|
// Expects multidimensional array like:
|
||||||
@ -273,7 +273,7 @@ function wp_default_packages_scripts( &$scripts ) {
|
|||||||
*
|
*
|
||||||
* @param WP_Scripts $scripts WP_Scripts object.
|
* @param WP_Scripts $scripts WP_Scripts object.
|
||||||
*/
|
*/
|
||||||
function wp_default_packages_inline_scripts( &$scripts ) {
|
function wp_default_packages_inline_scripts( $scripts ) {
|
||||||
global $wp_locale;
|
global $wp_locale;
|
||||||
|
|
||||||
if ( isset( $scripts->registered['wp-api-fetch'] ) ) {
|
if ( isset( $scripts->registered['wp-api-fetch'] ) ) {
|
||||||
@ -521,7 +521,7 @@ function wp_tinymce_inline_scripts() {
|
|||||||
*
|
*
|
||||||
* @param WP_Scripts $scripts WP_Scripts object.
|
* @param WP_Scripts $scripts WP_Scripts object.
|
||||||
*/
|
*/
|
||||||
function wp_default_packages( &$scripts ) {
|
function wp_default_packages( $scripts ) {
|
||||||
wp_default_packages_vendor( $scripts );
|
wp_default_packages_vendor( $scripts );
|
||||||
wp_register_tinymce_scripts( $scripts );
|
wp_register_tinymce_scripts( $scripts );
|
||||||
wp_default_packages_scripts( $scripts );
|
wp_default_packages_scripts( $scripts );
|
||||||
@ -580,7 +580,7 @@ function wp_scripts_get_suffix( $type = '' ) {
|
|||||||
*
|
*
|
||||||
* @param WP_Scripts $scripts WP_Scripts object.
|
* @param WP_Scripts $scripts WP_Scripts object.
|
||||||
*/
|
*/
|
||||||
function wp_default_scripts( &$scripts ) {
|
function wp_default_scripts( $scripts ) {
|
||||||
$suffix = wp_scripts_get_suffix();
|
$suffix = wp_scripts_get_suffix();
|
||||||
$dev_suffix = wp_scripts_get_suffix( 'dev' );
|
$dev_suffix = wp_scripts_get_suffix( 'dev' );
|
||||||
$guessurl = site_url();
|
$guessurl = site_url();
|
||||||
@ -1615,7 +1615,7 @@ function wp_default_scripts( &$scripts ) {
|
|||||||
*
|
*
|
||||||
* @param WP_Styles $styles
|
* @param WP_Styles $styles
|
||||||
*/
|
*/
|
||||||
function wp_default_styles( &$styles ) {
|
function wp_default_styles( $styles ) {
|
||||||
// Include an unmodified $wp_version.
|
// Include an unmodified $wp_version.
|
||||||
require ABSPATH . WPINC . '/version.php';
|
require ABSPATH . WPINC . '/version.php';
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.4-beta2-47354';
|
$wp_version = '5.4-beta2-47355';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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