Ticket #42645: 42645.2.diff
| File 42645.2.diff, 1.4 KB (added by , 6 years ago) |
|---|
-
src/wp-includes/theme.php
1917 1917 * It is a better option to use that class and add any RTL styles to the main stylesheet. 1918 1918 * 1919 1919 * @since 3.0.0 1920 * @since 5.3.0 Add version support. 1920 1921 * 1921 1922 * @global array $editor_styles 1922 1923 * 1923 1924 * @param array|string $stylesheet Optional. Stylesheet name or array thereof, relative to theme root. 1924 1925 * Defaults to 'editor-style.css' 1926 * @param array|string $veresion Optional. Stylesheet version or array thereof. 1927 * The versions will be attach to stylesheets 1928 * respectively. 1925 1929 */ 1926 function add_editor_style( $stylesheet = 'editor-style.css' ) {1930 function add_editor_style( $stylesheet = 'editor-style.css', $version = '' ) { 1927 1931 global $editor_styles; 1928 1932 1929 1933 add_theme_support( 'editor-style' ); … … 1931 1935 $editor_styles = (array) $editor_styles; 1932 1936 $stylesheet = (array) $stylesheet; 1933 1937 1938 if ( $version ) { 1939 $version = (array) $version; 1940 $count = min( count( $version ), count( $stylesheet ) ); 1941 for ( $i = 0; $i < $count; $i++ ) { 1942 $stylesheet[ $i ] .= '?ver=' . $version[ $i ]; 1943 } 1944 } 1945 1934 1946 if ( is_rtl() ) { 1935 1947 $rtl_stylesheet = str_replace( '.css', '-rtl.css', $stylesheet[0] ); 1936 1948 $stylesheet[] = $rtl_stylesheet;