wp-includes/deprecated.php:5417Runs the theme.json webfonts handler.
function _wp_theme_json_webfonts_handler() { _deprecated_function( __FUNCTION__, '6.4.0', 'wp_print_font_faces' ); // Block themes are unavailable during installation. if ( wp_installing() ) { return; } if ( ! wp_theme_has_theme_json() ) { return; } // Webfonts to be processed. $registered_webfonts = array(); /** * Gets the webfonts from theme.json. * * @since 6.0.0 * * @return array Array of defined webfonts. */ $fn_get_webfonts_from_theme_json = static function() { // Get settings from theme.json. $settings = WP_Theme_JSON_Resolver::get_merged_data()->get_settings(); // If in the editor, add webfonts defined in variations. if ( is_admin() || wp_is_rest_endpoint() ) { $variations = WP_Theme_JSON_Resolver::get_style_variations(); foreach ( $variations as $variation ) { // Skip if fontFamilies are not defined in the variation. if ( empty( $variation['settings']['typography']['fontFamilies'] ) ) { continue; } // Initialize the array structure. if ( empty( $settings['typography'] ) ) { $settings['typography'] = array(); } if ( empty( $settings['typography']['fontFamilies'] ) ) { $settings['typography']['fontFamilies'] = array(); } if ( empty( $settings['typography']['fontFamilies']['theme'] ) ) { $settings['typography']['fontFamilies']['theme'] = array(); } // Combine variations with settings. Remove duplicates. $settings['typography']['fontFamilies']['theme'] = array_merge( $settings['typography']['fontFamilies']['theme'], $variation['settings']['typography']['fontFamilies']['theme'] ); $settings['typography']['fontFamilies'] = array_unique( $settings['typography']['fontFamilies'] ); } } // Bail out early if there are no settings for webfonts. if ( empty( $settings['typography']['fontFamilies'] ) ) { return array(); } $webfonts = array(); // Look for fontFamilies. foreach ( $settings['typography']['fontFamilies'] as $font_families ) { foreach ( $font_families as $font_family ) { // Skip if fontFace is not defined. if ( empty( $font_family['fontFace'] ) ) { continue; } // Skip if fontFace is not an array of webfonts. if ( ! is_array( $font_family['fontFace'] ) ) { continue; } $webfonts = array_merge( $webfonts, $font_family['fontFace'] ); } } return $webfonts; };Introduced in 6.0.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
src/wp-includes/deprecated.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.