Skip to content

Instantly share code, notes, and snippets.

@scottblackburn
scottblackburn / class-font-display.php
Last active October 9, 2025 16:03
Changing @font-face font-display setting when using theme.json
public function __construct() {
add_action( 'init', [ $this, 'set_font_display_swap' ] );
}
/**
* Set font-display to swap for all loaded fonts.
*
* @return array Modified font data with font-display set.
*/
public function set_font_display_swap() {