From 82bc2c7b45ab36f01d995fd9226a247c763eefb4 Mon Sep 17 00:00:00 2001 From: hellofromtonya Date: Thu, 4 May 2023 13:23:16 -0500 Subject: [PATCH] Auto queue before printing --- lib/experimental/fonts-api/fonts-api.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/experimental/fonts-api/fonts-api.php b/lib/experimental/fonts-api/fonts-api.php index 87fb951f0be3ae..c28bf6e71a8ed7 100644 --- a/lib/experimental/fonts-api/fonts-api.php +++ b/lib/experimental/fonts-api/fonts-api.php @@ -191,6 +191,11 @@ function wp_print_fonts( $handles = false ) { _wp_scripts_maybe_doing_it_wrong( __FUNCTION__ ); + // Automatically enqueue all user-selected fonts. + if ( false === $handles ) { + WP_Fonts_Resolver::enqueue_user_selected_fonts(); + } + return $wp_fonts->do_items( $handles ); } }