This commit is contained in:
2026-04-19 17:44:36 +03:00
parent 7b97126aa5
commit 646cbe9bba
3 changed files with 35 additions and 2 deletions

BIN
2026-04-19_17-14-30.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

BIN
2026-04-19_17-30-11.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

View File

@@ -470,7 +470,7 @@ function twentytwentyfour_test1_assets() {
wp_enqueue_style( wp_enqueue_style(
'twentytwentyfour-test1-fonts', 'twentytwentyfour-test1-fonts',
'https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;700;800&display=swap', 'https://fonts.googleapis.com/css2?family=Manrope:wght@400;700&display=swap',
array(), array(),
null null
); );
@@ -546,6 +546,39 @@ function twentytwentyfour_test1_assets() {
} }
add_action( 'wp_enqueue_scripts', 'twentytwentyfour_test1_assets', 100 ); add_action( 'wp_enqueue_scripts', 'twentytwentyfour_test1_assets', 100 );
/**
* Trim non-critical WooCommerce frontend assets on the custom homepage.
*
* @since Twenty Twenty-Four 1.0
* @return void
*/
function twentytwentyfour_optimize_front_page_assets() {
if ( is_admin() || ! is_front_page() ) {
return;
}
$style_handles = array(
'woocommerce-layout',
'woocommerce-smallscreen',
'woocommerce-general',
'woocommerce-blocktheme',
'wc-blocks-style',
);
foreach ( $style_handles as $handle ) {
wp_dequeue_style( $handle );
}
wp_deregister_script( 'jquery-migrate' );
global $wp_scripts;
if ( $wp_scripts instanceof WP_Scripts && isset( $wp_scripts->registered['jquery'] ) ) {
$wp_scripts->registered['jquery']->deps = array_diff( $wp_scripts->registered['jquery']->deps, array( 'jquery-migrate' ) );
}
}
add_action( 'wp_enqueue_scripts', 'twentytwentyfour_optimize_front_page_assets', 120 );
/** /**
* Send a formatted message to Telegram. * Send a formatted message to Telegram.
* *
@@ -757,7 +790,7 @@ function twentytwentyfour_test1_shared_shell_assets() {
wp_enqueue_style( wp_enqueue_style(
'twentytwentyfour-test1-fonts', 'twentytwentyfour-test1-fonts',
'https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;700;800&display=swap', 'https://fonts.googleapis.com/css2?family=Manrope:wght@400;700&display=swap',
array(), array(),
null null
); );