Ticket #55917: 55917.2.diff
File 55917.2.diff, 876 bytes (added by , 2 years ago) |
---|
-
src/wp-includes/script-loader.php
3523 3523 wp_add_inline_style( 'wp-block-library', $styles ); 3524 3524 }; 3525 3525 3526 add_action( 'wp_loaded', $fn_register_webfonts ); 3526 /* 3527 * Webfonts need to be properly loaded and available: 3528 * - In the block editor, both in the normal Edit screen and the Site Editor. 3529 * - In REST API calls for the editor, because some styles get added via REST calls. 3530 * - On the front end. 3531 * The 'wp' action is one of the very few that work for all cases. 3532 */ 3533 add_action( 'wp', $fn_register_webfonts ); 3527 3534 add_action( 'wp_enqueue_scripts', $fn_generate_and_enqueue_styles ); 3528 3535 add_action( 'admin_init', $fn_generate_and_enqueue_editor_styles ); 3529 3536 }