WP_Font_Face::get_css
Gets the @font-face CSS styles for locally-hosted font files.
This method does the following processing tasks:
1. Orchestrates an optimized `src` (with format) for browser support. 2. Generates the `@font-face` for all its fonts.
Метод класса: WP_Font_Face{}
Хуков нет.
Возвращает
Строку. The @font-face CSS styles.
Использование
// private - только в коде основоного (родительского) класса $result = $this->get_css( $font_faces );
- $font_faces(array[]) (обязательный)
- The font-faces to generate @font-face CSS styles.
Список изменений
| С версии 6.4.0 | Введена. |
Код WP_Font_Face::get_css() WP Font Face::get css WP 6.9
private function get_css( $font_faces ) {
$css = '';
foreach ( $font_faces as $font_face ) {
// Order the font's `src` items to optimize for browser support.
$font_face = $this->order_src( $font_face );
// Build the @font-face CSS for this font.
$css .= '@font-face{' . $this->build_font_face_css( $font_face ) . '}' . "\n";
}
// Don't print the last newline character.
return rtrim( $css, "\n" );
}