Make WordPress Core

Changeset 44231 for branches/5.0


Ignore:
Timestamp:
12/16/2018 11:05:53 AM (6 years ago)
Author:
ocean90
Message:

Script Loader: Pass the suffix to package style handles to ensure correct file names for minified RTL stylesheets.

See #45547.

File:
1 edited

Legend:

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

    r44211 r44231  
    17641764    $styles->add( 'open-sans', $open_sans_font_url ); // No longer used in core as of 4.6
    17651765
    1766     // RTL CSS
    1767     $rtl_styles = array(
    1768         // wp-admin
    1769         'common', 'forms', 'admin-menu', 'dashboard', 'list-tables', 'edit', 'revisions', 'media', 'themes', 'about', 'nav-menus',
    1770         'widgets', 'site-icon', 'l10n', 'install', 'wp-color-picker', 'customize-controls', 'customize-widgets', 'customize-nav-menus', 'customize-preview',
    1771         'ie', 'login',
    1772         // wp-includes
    1773         'buttons', 'admin-bar', 'wp-auth-check', 'editor-buttons', 'media-views', 'wp-pointer',
    1774         'wp-jquery-ui-dialog',
    1775         // deprecated
    1776         'deprecated-media', 'farbtastic',
    1777     );
    1778 
    1779     foreach ( $rtl_styles as $rtl_style ) {
    1780         $styles->add_data( $rtl_style, 'rtl', 'replace' );
    1781         if ( $suffix ) {
    1782             $styles->add_data( $rtl_style, 'suffix', $suffix );
    1783         }
    1784     }
    1785 
    17861766    // Packages styles
    17871767    $fonts_url = '';
     
    17991779
    18001780    $styles->add( 'wp-block-library-theme', "/wp-includes/css/dist/block-library/theme$suffix.css" );
    1801     $styles->add_data( 'wp-block-library-theme', 'rtl', 'replace' );
    18021781
    18031782    $styles->add(
     
    18121791        )
    18131792    );
    1814     $styles->add_data( 'wp-edit-blocks', 'rtl', 'replace' );
    18151793
    18161794    $package_styles = array(
     
    18261804    foreach ( $package_styles as $package => $dependencies ) {
    18271805        $handle  = 'wp-' . $package;
    1828         $path     = "/wp-includes/css/dist/$package/style$suffix.css";
     1806        $path    = "/wp-includes/css/dist/$package/style$suffix.css";
    18291807
    18301808        $styles->add( $handle, $path, $dependencies );
    1831         $styles->add_data( $handle, 'rtl', 'replace' );
     1809    }
     1810
     1811    // RTL CSS
     1812    $rtl_styles = array(
     1813        // Admin CSS
     1814        'common', 'forms', 'admin-menu', 'dashboard', 'list-tables', 'edit', 'revisions', 'media', 'themes', 'about', 'nav-menus',
     1815        'widgets', 'site-icon', 'l10n', 'install', 'wp-color-picker', 'customize-controls', 'customize-widgets', 'customize-nav-menus', 'customize-preview',
     1816        'ie', 'login',
     1817        // Includes CSS
     1818        'buttons', 'admin-bar', 'wp-auth-check', 'editor-buttons', 'media-views', 'wp-pointer',
     1819        'wp-jquery-ui-dialog',
     1820        // Package styles
     1821        'wp-block-library-theme', 'wp-edit-blocks', 'wp-block-library', 'wp-components', 'wp-edit-post', 'wp-editor', 'wp-format-library',
     1822        'wp-list-reusable-blocks', 'wp-nux',
     1823        // Deprecated CSS
     1824        'deprecated-media', 'farbtastic',
     1825    );
     1826
     1827    foreach ( $rtl_styles as $rtl_style ) {
     1828        $styles->add_data( $rtl_style, 'rtl', 'replace' );
     1829        if ( $suffix ) {
     1830            $styles->add_data( $rtl_style, 'suffix', $suffix );
     1831        }
    18321832    }
    18331833}
Note: See TracChangeset for help on using the changeset viewer.