Ticket #59018: 59018.diff
File 59018.diff, 1.8 KB (added by , 14 months ago) |
---|
-
src/wp-includes/blocks.php
137 137 // Cache $template_path_norm and $stylesheet_path_norm to avoid unnecessary additional calls. 138 138 static $template_path_norm = ''; 139 139 static $stylesheet_path_norm = ''; 140 141 // Trailing slashes are needed to properly match parent and child themes directories with similar names. 140 142 if ( ! $template_path_norm || ! $stylesheet_path_norm ) { 141 $template_path_norm = wp_normalize_path( get_template_directory() );142 $stylesheet_path_norm = wp_normalize_path( get_stylesheet_directory() );143 $template_path_norm = trailingslashit( wp_normalize_path( get_template_directory() ) ); 144 $stylesheet_path_norm = trailingslashit( wp_normalize_path( get_stylesheet_directory() ) ); 143 145 } 144 146 145 147 $script_path_norm = wp_normalize_path( realpath( dirname( $metadata['file'] ) . '/' . $script_path ) ); … … 254 256 // Cache $template_path_norm and $stylesheet_path_norm to avoid unnecessary additional calls. 255 257 static $template_path_norm = ''; 256 258 static $stylesheet_path_norm = ''; 259 260 // Trailing slashes are needed to properly match parent and child themes directories with similar names. 257 261 if ( ! $template_path_norm || ! $stylesheet_path_norm ) { 258 $template_path_norm = wp_normalize_path( get_template_directory() );259 $stylesheet_path_norm = wp_normalize_path( get_stylesheet_directory() );262 $template_path_norm = trailingslashit( wp_normalize_path( get_template_directory() ) ); 263 $stylesheet_path_norm = trailingslashit( wp_normalize_path( get_stylesheet_directory() ) ); 260 264 } 261 265 262 266 // Determine if the block style was registered in a theme, by checking if the script path starts with either