WordPress.org

Make WordPress Core

Ticket #42505: 42505-wp-scripts.diff

File 42505-wp-scripts.diff, 2.3 KB (added by desrosj, 3 years ago)
  • src/wp-includes/class.wp-scripts.php

     
    204204                        return $output;
    205205                }
    206206
    207                 echo "<script type='text/javascript'>\n"; // CDATA and type='text/javascript' is not needed for HTML 5
     207                echo "<script type='text/javascript'>\n"; // CDATA and type='text/javascript' is not needed for HTML 5.
    208208                echo "/* <![CDATA[ */\n";
    209209                echo "$output\n";
    210210                echo "/* ]]> */\n";
     
    221221         *
    222222         * @see WP_Dependencies::do_item()
    223223         *
    224          * @param string $handle    The script's registered handle.
     224         * @param string    $handle The script's registered handle.
    225225         * @param int|false $group  Optional. Group level: (int) level, (false) no groups. Default false.
    226226         * @return bool True on success, false on failure.
    227227         */
     
    401401         * @param string $handle   Name of the script to add the inline script to. Must be lowercase.
    402402         * @param string $position Optional. Whether to add the inline script before the handle
    403403         *                         or after. Default 'after'.
    404          * @param bool $echo       Optional. Whether to echo the script instead of just returning it.
     404         * @param bool   $echo     Optional. Whether to echo the script instead of just returning it.
    405405         *                         Default true.
    406406         * @return string|false Script on success, false otherwise.
    407407         */
     
    426426         *
    427427         * @since 2.1.0
    428428         *
    429          * @param string $handle
    430          * @param string $object_name
    431          * @param array $l10n
    432          * @return bool
     429         * @param string $handle      Name of the script to attach data to.
     430         * @param string $object_name Name of the variable that will contain the data.
     431         * @param array  $l10n        Array of data to localize.
     432         * @return bool True on success, false on failure.
    433433         */
    434434        public function localize( $handle, $object_name, $l10n ) {
    435435                if ( $handle === 'jquery' ) {
     
    436436                        $handle = 'jquery-core';
    437437                }
    438438
    439                 if ( is_array( $l10n ) && isset( $l10n['l10n_print_after'] ) ) { // back compat, preserve the code in 'l10n_print_after' if present
     439                if ( is_array( $l10n ) && isset( $l10n['l10n_print_after'] ) ) { // back compat, preserve the code in 'l10n_print_after' if present.
    440440                        $after = $l10n['l10n_print_after'];
    441441                        unset( $l10n['l10n_print_after'] );
    442442                }