PluginProbe
Gutenberg / 18.9.0
Gutenberg v18.9.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 12.6.0 All 403 releases
gutenberg / lib / experimental / font-face / bc-layer / class-wp-webfonts.php

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

146 lines 3.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Webfonts API class: backwards-compatibility (BC) layer for all
4 * deprecated publicly exposed methods and functionality.
5 *
6 * This class/file will NOT be backported to Core. Rather for sites
7 * using the previous API, it exists to prevent breakages, giving
8 * developers time to upgrade their code.
9 *
10 * @package Gutenberg
11 * @subpackage Fonts API's BC Layer
12 * @since X.X.X
13 */
14
15 if ( ! class_exists( 'WP_Webfonts' ) ) {
16
17 /**
18 * Class WP_Webfonts
19 *
20 * @since X.X.X
21 * @deprecated 15.1 Use WP_Fonts instead.
22 * @deprecated 16.3.0 Fonts API is not supported.
23 */
24 class WP_Webfonts {
25
26 /**
27 * Constructor.
28 *
29 * @since X.X.X
30 * @deprecated 16.3.0
31 */
32 public function __construct() {
33 _deprecated_function( __METHOD__, 'Gutenberg 16.3.0' );
34 }
35
36 /**
37 * Gets the font slug.
38 *
39 * @since X.X.X
40 * @deprecated Use WP_Fonts_Utils::convert_font_family_into_handle() or WP_Fonts_Utils::get_font_family_from_variation().
41 * @deprecated 16.3.0 This method is not supported.
42 *
43 * @return false False.
44 */
45 public static function get_font_slug() {
46 _deprecated_function( __METHOD__, 'Gutenberg 16.3.0' );
47 return false;
48 }
49
50 /**
51 * Initializes the API.
52 *
53 * @since 6.0.0
54 * @deprecated 14.9.1 Use wp_fonts().
55 */
56 public static function init() {
57 _deprecated_function( __METHOD__, 'GB 14.9.1', 'wp_fonts()' );
58 }
59
60 /**
61 * Get the list of all registered font family handles.
62 *
63 * @since X.X.X
64 * @deprecated GB 15.8.0 Use wp_fonts()->get_registered_font_families().
65 * @deprecated 16.3.0 Register is not supported.
66 *
67 * @return array Empty array.
68 */
69 public function get_registered_font_families() {
70 _deprecated_function( __METHOD__, 'Gutenberg 15.8.0' );
71 return array();
72 }
73
74 /**
75 * Gets the list of registered fonts.
76 *
77 * @since 6.0.0
78 * @deprecated 14.9.1 Use wp_fonts()->get_registered().
79 * @deprecated 16.3.0 Register is not supported.
80 *
81 * @return array Empty array.
82 */
83 public function get_registered_webfonts() {
84 _deprecated_function( __METHOD__, 'Gutenberg 14.9.1' );
85
86 return array();
87 }
88
89 /**
90 * Gets the list of enqueued fonts.
91 *
92 * @since 6.0.0
93 * @deprecated 14.9.1 Use wp_fonts()->get_enqueued().
94 * @deprecated 16.3.0 Enqueue is not supported.
95 *
96 * @return array Empty array.
97 */
98 public function get_enqueued_webfonts() {
99 _deprecated_function( __METHOD__, 'Gutenberg 14.9.1' );
100 return array();
101 }
102
103 /**
104 * Gets the list of all fonts.
105 *
106 * @since X.X.X
107 * @deprecated GB 14.9.1 Use wp_fonts()->get_registered().
108 * @deprecated 16.3.0 This method is not supported.
109 *
110 * @return array[]
111 */
112 public function get_all_webfonts() {
113 _deprecated_function( __METHOD__, 'Gutenberg 14.9.1', 'wp_fonts()->get_registered()' );
114 return array();
115 }
116
117 /**
118 * Registers a webfont.
119 *
120 * @since 6.0.0
121 * @deprecated GB 14.9.1 Use wp_register_fonts().
122 * @deprecated 16.3.0 Register is not supported.
123 *
124 * @return bool False.
125 */
126 public function register_webfont() {
127 _deprecated_function( __METHOD__, 'GB 14.9.1', 'wp_register_fonts()' );
128 return false;
129 }
130
131 /**
132 * Enqueue a font-family that has been already registered.
133 *
134 * @since XX.X
135 * @deprecated 14.9.1 Use wp_enqueue_fonts().
136 * @deprecated 16.3.0 Register is not supported.
137 *
138 * @return bool False.
139 */
140 public function enqueue_webfont() {
141 _deprecated_function( __METHOD__, 'Gutenberg 14.9.1' );
142 return false;
143 }
144 }
145 }
146