Make WordPress Core

Ticket #60779: 60779.diff

File 60779.diff, 1.9 KB (added by sabernhardt, 15 months ago)

uses $theme_version variable in twentytwenty_register_styles() and adds the variable in twentytwenty_block_editor_styles()

  • src/wp-content/themes/twentytwenty/functions.php

     
    192192        wp_style_add_data( 'twentytwenty-style', 'rtl', 'replace' );
    193193
    194194        // Enqueue the CSS file for the variable font, Inter.
    195         wp_enqueue_style( 'twentytwenty-fonts', get_theme_file_uri( '/assets/css/font-inter.css' ), array(), wp_get_theme()->get( 'Version' ), 'all' );
     195        wp_enqueue_style( 'twentytwenty-fonts', get_theme_file_uri( '/assets/css/font-inter.css' ), array(), $theme_version, 'all' );
    196196
    197197        // Add output of Customizer settings as inline style.
    198198        $customizer_css = twentytwenty_get_customizer_css( 'front-end' );
     
    425425 */
    426426function twentytwenty_block_editor_styles() {
    427427
     428        $theme_version = wp_get_theme()->get( 'Version' );
     429
    428430        // Enqueue the editor styles.
    429         wp_enqueue_style( 'twentytwenty-block-editor-styles', get_theme_file_uri( '/assets/css/editor-style-block.css' ), array(), wp_get_theme()->get( 'Version' ), 'all' );
     431        wp_enqueue_style( 'twentytwenty-block-editor-styles', get_theme_file_uri( '/assets/css/editor-style-block.css' ), array(), $theme_version, 'all' );
    430432        wp_style_add_data( 'twentytwenty-block-editor-styles', 'rtl', 'replace' );
    431433
    432434        // Add inline style from the Customizer.
     
    436438        }
    437439
    438440        // Enqueue the CSS file for the variable font, Inter.
    439         wp_enqueue_style( 'twentytwenty-fonts', get_theme_file_uri( '/assets/css/font-inter.css' ), array(), wp_get_theme()->get( 'Version' ), 'all' );
     441        wp_enqueue_style( 'twentytwenty-fonts', get_theme_file_uri( '/assets/css/font-inter.css' ), array(), $theme_version, 'all' );
    440442
    441443        // Add inline style for non-latin fonts.
    442444        $custom_css = TwentyTwenty_Non_Latin_Languages::get_non_latin_css( 'block-editor' );