Title: WP_Font_Face::__construct
Published: November 8, 2023
Last modified: February 24, 2026

---

# WP_Font_Face::__construct()

## In this article

 * [Source](https://developer.wordpress.org/reference/classes/wp_font_face/__construct/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/wp_font_face/__construct/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_font_face/__construct/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_font_face/__construct/?output_format=md#wp--skip-link--target)

Creates and initializes an instance of [WP_Font_Face](https://developer.wordpress.org/reference/classes/wp_font_face/).

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_font_face/__construct/?output_format=md#source)󠁿

    ```php
    public function __construct() {
    	if (
    		function_exists( 'is_admin' ) && ! is_admin()
    		&&
    		function_exists( 'current_theme_supports' ) && ! current_theme_supports( 'html5', 'style' )
    	) {
    		$this->style_tag_attrs = array( 'type' => 'text/css' );
    	}
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/fonts/class-wp-font-face.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/fonts/class-wp-font-face.php#L80)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/fonts/class-wp-font-face.php#L80-L88)

## 󠀁[Related](https://developer.wordpress.org/reference/classes/wp_font_face/__construct/?output_format=md#related)󠁿

| Uses | Description | 
| [current_theme_supports()](https://developer.wordpress.org/reference/functions/current_theme_supports/)`wp-includes/theme.php` |

Checks a theme’s support for a given feature.

  | 
| [is_admin()](https://developer.wordpress.org/reference/functions/is_admin/)`wp-includes/load.php` |

Determines whether the current request is for an administrative interface page.

  |

| Used by | Description | 
| [wp_print_font_faces()](https://developer.wordpress.org/reference/functions/wp_print_font_faces/)`wp-includes/fonts.php` |

Generates and prints font-face styles for given fonts or theme.json fonts.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/wp_font_face/__construct/?output_format=md#changelog)󠁿

| Version | Description | 
| [6.4.0](https://developer.wordpress.org/reference/since/6.4.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_font_face%2F__construct%2F)
before being able to contribute a note or feedback.