Make WordPress Core

Changeset 41360


Ignore:
Timestamp:
09/09/2017 08:43:09 PM (7 years ago)
Author:
westonruter
Message:

Widgets: Prevent fatal error due to calling undefined wp_json_encode() when requesting the load-scripts.php endpoint.

Props Otto42.
Amends [41352].
Fixes #41610.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/script-loader.php

    r41352 r41360  
    673673
    674674        $scripts->add( 'admin-widgets', "/wp-admin/js/widgets$suffix.js", array( 'jquery-ui-sortable', 'jquery-ui-draggable', 'jquery-ui-droppable' ), false, 1 );
    675         $scripts->add_inline_script( 'admin-widgets', sprintf( 'wpWidgets.l10n = %s;', wp_json_encode( array(
     675        did_action( 'init' ) && $scripts->add_inline_script( 'admin-widgets', sprintf( 'wpWidgets.l10n = %s;', wp_json_encode( array(
    676676            'save' => __( 'Save' ),
    677677            'saved' => __( 'Saved' ),
Note: See TracChangeset for help on using the changeset viewer.