- Timestamp:
- 02/12/2026 07:56:42 PM (2 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-content/themes/twentytwentyone/functions.php
r61302 r61628 24 24 * 25 25 * @since Twenty Twenty-One 1.0 26 * @since Twenty Twenty-One 2.8 Removed editor stylesheet for Internet Explorer. 26 27 * 27 28 * @return void … … 124 125 } 125 126 126 $editor_stylesheet_path = './assets/css/style-editor.css';127 128 // Note, the is_IE global variable is defined by WordPress and is used129 // to detect if the current browser is internet explorer.130 global $is_IE;131 if ( $is_IE ) {132 $editor_stylesheet_path = './assets/css/ie-editor.css';133 }134 135 127 // Enqueue editor styles. 136 add_editor_style( $editor_stylesheet_path);128 add_editor_style( './assets/css/style-editor.css' ); 137 129 138 130 // Add custom editor font sizes. … … 391 383 * 392 384 * @since Twenty Twenty-One 1.0 393 * 394 * @global bool $is_IE 395 * @global WP_Scripts $wp_scripts 385 * @since Twenty Twenty-One 2.8 Removed Internet Explorer support. 396 386 * 397 387 * @return void 398 388 */ 399 389 function twenty_twenty_one_scripts() { 400 // Note, the is_IE global variable is defined by WordPress and is used 401 // to detect if the current browser is internet explorer. 402 global $is_IE, $wp_scripts; 403 if ( $is_IE ) { 404 // If IE 11 or below, use a flattened stylesheet with static values replacing CSS Variables. 405 wp_enqueue_style( 'twenty-twenty-one-style', get_template_directory_uri() . '/assets/css/ie.css', array(), wp_get_theme()->get( 'Version' ) ); 406 } else { 407 // If not IE, use the standard stylesheet. 408 wp_enqueue_style( 'twenty-twenty-one-style', get_template_directory_uri() . '/style.css', array(), wp_get_theme()->get( 'Version' ) ); 409 } 390 // The standard stylesheet. 391 wp_enqueue_style( 'twenty-twenty-one-style', get_template_directory_uri() . '/style.css', array(), wp_get_theme()->get( 'Version' ) ); 410 392 411 393 // RTL styles. … … 420 402 } 421 403 422 // Register the IE11 polyfill file.404 // Register the handles for unused IE11 polyfill scripts. 423 405 wp_register_script( 424 406 'twenty-twenty-one-ie11-polyfills-asset', 425 get_template_directory_uri() . '/assets/js/polyfills.js',407 false, 426 408 array(), 427 409 wp_get_theme()->get( 'Version' ), 428 410 array( 'in_footer' => true ) 429 411 ); 430 431 // Register the IE11 polyfill loader.432 412 wp_register_script( 433 413 'twenty-twenty-one-ie11-polyfills', 434 null,414 false, 435 415 array(), 436 416 wp_get_theme()->get( 'Version' ), 437 417 array( 'in_footer' => true ) 438 );439 wp_add_inline_script(440 'twenty-twenty-one-ie11-polyfills',441 wp_get_script_polyfill(442 $wp_scripts,443 array(444 'Element.prototype.matches && Element.prototype.closest && window.NodeList && NodeList.prototype.forEach' => 'twenty-twenty-one-ie11-polyfills-asset',445 )446 )447 418 ); 448 419 … … 452 423 'twenty-twenty-one-primary-navigation-script', 453 424 get_template_directory_uri() . '/assets/js/primary-navigation.js', 454 array( 'twenty-twenty-one-ie11-polyfills'),425 array(), 455 426 wp_get_theme()->get( 'Version' ), 456 427 array( … … 465 436 'twenty-twenty-one-responsive-embeds-script', 466 437 get_template_directory_uri() . '/assets/js/responsive-embeds.js', 467 array( 'twenty-twenty-one-ie11-polyfills'),438 array(), 468 439 wp_get_theme()->get( 'Version' ), 469 440 array( 'in_footer' => true ) … … 631 602 * 632 603 * @since Twenty Twenty-One 1.0 604 * @deprecated Twenty Twenty-One 2.8 Removed Internet Explorer support. 633 605 * 634 606 * @return void … … 648 620 } 649 621 } 650 add_action( 'wp_footer', 'twentytwentyone_add_ie_class' );651 622 652 623 if ( ! function_exists( 'wp_get_list_item_separator' ) ) :
Note: See TracChangeset
for help on using the changeset viewer.