@@ -255,11 +255,9 @@ function twentynineteen_content_width() {
255255 * @since Twenty Nineteen 1.0
256256 */
257257function twentynineteen_scripts () {
258- $ url = twentynineteen_get_stylesheet_path ( 'style.css ' );
259- if ( is_rtl () ) {
260- $ url = twentynineteen_get_stylesheet_path ( 'style-rtl.css ' );
261- }
262- wp_enqueue_style ( 'twentynineteen-style ' , $ url , array (), wp_get_theme ()->get ( 'Version ' ) );
258+ wp_enqueue_style ( 'twentynineteen-style ' , get_stylesheet_uri (), array (), wp_get_theme ()->get ( 'Version ' ) );
259+
260+ wp_style_add_data ( 'twentynineteen-style ' , 'rtl ' , 'replace ' );
263261
264262 if ( has_nav_menu ( 'menu-1 ' ) ) {
265263 wp_enqueue_script (
@@ -284,7 +282,7 @@ function twentynineteen_scripts() {
284282 );
285283 }
286284
287- wp_enqueue_style ( 'twentynineteen-print-style ' , twentynineteen_get_stylesheet_path ( ' print.css ' ) , array (), wp_get_theme ()->get ( 'Version ' ), 'print ' );
285+ wp_enqueue_style ( 'twentynineteen-print-style ' , get_template_directory_uri () . ' / print.css ' , array (), wp_get_theme ()->get ( 'Version ' ), 'print ' );
288286
289287 if ( is_singular () && comments_open () && get_option ( 'thread_comments ' ) ) {
290288 wp_enqueue_script ( 'comment-reply ' );
@@ -397,34 +395,3 @@ function twentynineteen_register_block_patterns() {
397395}
398396
399397add_action ( 'init ' , 'twentynineteen_register_block_patterns ' );
400-
401- /**
402- * Gets the path to a stylesheet file, minified if available and appropriate.
403- *
404- * @since Twenty Nineteen 3.2
405- *
406- * @param string $src_path Source path, relative to the theme root.
407- * @return string URL to stylesheet.
408- */
409- function twentynineteen_get_stylesheet_path ( $ src_path ) {
410- $ min_path = (string ) preg_replace ( '/(?=\.css$)/ ' , '.min ' , $ src_path );
411-
412- $ use_min = ! ( defined ( 'SCRIPT_DEBUG ' ) && SCRIPT_DEBUG ) && ! strpos ( wp_get_wp_version (), '-src ' );
413-
414- if ( is_child_theme () ) {
415- if ( $ use_min && file_exists ( get_stylesheet_directory () . '/ ' . $ min_path ) ) {
416- return get_stylesheet_directory_uri () . '/ ' . $ min_path ;
417- }
418-
419- if ( file_exists ( get_stylesheet_directory () . '/ ' . $ src_path ) ) {
420- return get_stylesheet_directory_uri () . '/ ' . $ src_path ;
421- }
422- }
423-
424- if ( $ use_min && file_exists ( get_template_directory () . '/ ' . $ min_path ) ) {
425- return get_template_directory_uri () . '/ ' . $ min_path ;
426- }
427-
428- return get_template_directory_uri () . '/ ' . $ src_path ;
429- }
430-
0 commit comments