PluginProbe
Gutenberg / 18.9.0
Gutenberg v18.9.0
24.1.0 24.0.0 23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 All 404 releases
gutenberg / lib / experimental / font-face / bc-layer / class-wp-fonts-provider.php

class-wp-fonts-provider.php in Gutenberg 18.9.0, at lib/experimental/font-face/bc-layer/class-wp-fonts-provider.php

98 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Fonts API: Provider abstract class.
4 *
5 * Individual fonts providers should extend this class and implement.
6 *
7 * @package WordPress
8 * @subpackage Fonts API
9 * @since X.X.X
10 */
11
12 if ( ! class_exists( 'WP_Fonts_Provider' ) ) {
13
14 /**
15 * Abstract class for Fonts API providers.
16 *
17 * @since X.X.X
18 * @deprecated 16.3.0 Custom providers are not supported.
19 */
20 abstract class WP_Fonts_Provider {
21
22 /**
23 * The provider's unique ID.
24 *
25 * @since X.X.X
26 * @deprecated 16.3.0
27 *
28 * @var string
29 */
30 protected $id = '';
31
32 /**
33 * Fonts to be processed.
34 *
35 * @since X.X.X
36 * @deprecated 16.3.0
37 *
38 * @var array[]
39 */
40 protected $fonts = array();
41
42 /**
43 * Array of Font-face style tag's attribute(s)
44 * where the key is the attribute name and the
45 * value is its value.
46 *
47 * @since X.X.X
48 * @deprecated 16.3.0
49 *
50 * @var string[]
51 */
52 protected $style_tag_atts = array();
53
54 /**
55 * Sets this provider's fonts property.
56 *
57 * @since X.X.X
58 * @deprecated 16.3.0 Set is not supported.
59 */
60 public function set_fonts() {
61 _deprecated_function( __METHOD__, 'Gutenberg 16.3.0' );
62 }
63
64 /**
65 * Prints the generated styles.
66 *
67 * @since X.X.X
68 * @deprecated 16.3.0 Use wp_print_font_faces() instead.
69 */
70 public function print_styles() {
71 _deprecated_function( __METHOD__, 'Gutenberg 16.3.0', 'wp_print_font_faces' );
72 }
73
74 /**
75 * Gets the `@font-face` CSS for the provider's fonts.
76 *
77 * @since X.X.X
78 * @deprecated 16.3.0
79 *
80 * @return string The `@font-face` CSS.
81 */
82 abstract public function get_css();
83
84 /**
85 * Gets the `<style>` element for wrapping the `@font-face` CSS.
86 *
87 * @since X.X.X
88 * @deprecated 16.3.0 Get style element is not supported.
89 *
90 * @return string Empty string.
91 */
92 protected function get_style_element() {
93 _deprecated_function( __METHOD__, 'Gutenberg 16.3.0' );
94 return '';
95 }
96 }
97 }
98