WordPress.org

Make WordPress Core

Ticket #42645: 42645.3.diff

File 42645.3.diff, 1.4 KB (added by danieltj, 17 months ago)

Refreshed the patch and fixed CS issues.

  • wp-includes/theme.php

    diff --git wp-includes/theme.php wp-includes/theme.php
    index 4e5f63b..29f9d7a 100644
    function wp_update_custom_css_post( $css, $args = array() ) { 
    18251825 * It is a better option to use that class and add any RTL styles to the main stylesheet.
    18261826 *
    18271827 * @since 3.0.0
     1828 * @since 5.0.0 Added the optional `$version` parameter.
    18281829 *
    18291830 * @global array $editor_styles
    18301831 *
    18311832 * @param array|string $stylesheet Optional. Stylesheet name or array thereof, relative to theme root.
    18321833 *                                     Defaults to 'editor-style.css'
     1834 * @param string       $version    Optional. The version number attached to this stylesheet.
    18331835 */
    1834 function add_editor_style( $stylesheet = 'editor-style.css' ) {
     1836function add_editor_style( $stylesheet = 'editor-style.css', $version = '' ) {
    18351837        add_theme_support( 'editor-style' );
    18361838
    1837         if ( ! is_admin() )
     1839        if ( ! is_admin() ) {
    18381840                return;
     1841        }
    18391842
    18401843        global $editor_styles;
     1844        global $wp_version;
     1845
     1846        if ( '' == $version ) {
     1847                $version = $wp_version;
     1848        }
     1849
    18411850        $editor_styles = (array) $editor_styles;
    18421851        $stylesheet    = (array) $stylesheet;
     1852        $version       = (array) $version;
     1853
    18431854        if ( is_rtl() ) {
    18441855                $rtl_stylesheet = str_replace('.css', '-rtl.css', $stylesheet[0]);
    18451856                $stylesheet[] = $rtl_stylesheet;
    18461857        }
    18471858
    1848         $editor_styles = array_merge( $editor_styles, $stylesheet );
     1859        $editor_styles = array_merge( $editor_styles, $stylesheet, $version );
    18491860}
    18501861
    18511862/**