| 1 |
<?php |
| 2 |
/** |
| 3 |
* Deprecated functions provided here to give extenders time to change |
| 4 |
* their plugins/themes before this API is introduced into Core. |
| 5 |
* |
| 6 |
* BACKPORT NOTE: Do not backport these deprecated functions to Core. |
| 7 |
* |
| 8 |
* @package WordPress |
| 9 |
* @subpackage Fonts API |
| 10 |
* @since X.X.X |
| 11 |
*/ |
| 12 |
|
| 13 |
if ( ! function_exists( 'wp_webfonts' ) ) { |
| 14 |
/** |
| 15 |
* Initialize $wp_webfonts if it has not been set. |
| 16 |
* |
| 17 |
* @since X.X.X |
| 18 |
* @deprecated 15.1 Use wp_fonts() instead. |
| 19 |
* @deprecated 16.3.0 No longer functional. Do not use. |
| 20 |
* |
| 21 |
* @global WP_Webfonts $wp_webfonts |
| 22 |
* |
| 23 |
* @return WP_Webfonts WP_Webfonts instance. |
| 24 |
*/ |
| 25 |
function wp_webfonts() { |
| 26 |
_deprecated_function( __FUNCTION__, 'Gutenberg 15.1' ); |
| 27 |
|
| 28 |
global $wp_webfonts; |
| 29 |
|
| 30 |
if ( ! ( $wp_webfonts instanceof WP_Webfonts ) ) { |
| 31 |
$wp_webfonts = new WP_Webfonts( wp_fonts() ); |
| 32 |
} |
| 33 |
|
| 34 |
return $wp_webfonts; |
| 35 |
} |
| 36 |
} |
| 37 |
|
| 38 |
if ( ! function_exists( 'wp_register_webfonts' ) ) { |
| 39 |
/** |
| 40 |
* Registers one or more font-families and each of their variations. |
| 41 |
* |
| 42 |
* @since X.X.X |
| 43 |
* @deprecated 15.1 Use wp_register_fonts() instead. |
| 44 |
* @deprecated 16.3.0 Register is not supported. |
| 45 |
* |
| 46 |
* @return array Empty array. |
| 47 |
*/ |
| 48 |
function wp_register_webfonts() { |
| 49 |
_deprecated_function( __FUNCTION__, 'Gutenberg 15.1' ); |
| 50 |
return array(); |
| 51 |
} |
| 52 |
} |
| 53 |
|
| 54 |
if ( ! function_exists( 'wp_register_webfont' ) ) { |
| 55 |
/** |
| 56 |
* Registers a single webfont. |
| 57 |
* |
| 58 |
* @since X.X.X |
| 59 |
* @deprecated 14.9.1 Use wp_register_fonts(). |
| 60 |
* @deprecated 16.3.0 Register is not supported. |
| 61 |
* |
| 62 |
* @return bool False. |
| 63 |
*/ |
| 64 |
function wp_register_webfont() { |
| 65 |
_deprecated_function( __FUNCTION__, 'Gutenberg 14.9.1' ); |
| 66 |
return false; |
| 67 |
} |
| 68 |
} |
| 69 |
|
| 70 |
if ( ! function_exists( 'wp_enqueue_webfonts' ) ) { |
| 71 |
/** |
| 72 |
* Enqueues one or more font family and all of its variations. |
| 73 |
* |
| 74 |
* @since X.X.X |
| 75 |
* @deprecated 15.1 Use wp_enqueue_fonts() instead. |
| 76 |
* @deprecated 16.3.0 Enqueue is not supported. |
| 77 |
*/ |
| 78 |
function wp_enqueue_webfonts() { |
| 79 |
_deprecated_function( __FUNCTION__, 'Gutenberg 15.1' ); |
| 80 |
} |
| 81 |
} |
| 82 |
|
| 83 |
if ( ! function_exists( 'wp_enqueue_webfont' ) ) { |
| 84 |
/** |
| 85 |
* Enqueue a single font family that has been registered beforehand. |
| 86 |
* |
| 87 |
* @since X.X.X |
| 88 |
* @deprecated 14.9.1 Use wp_enqueue_fonts() instead. |
| 89 |
* @deprecated 16.3.0 Enqueue is not supported. |
| 90 |
* |
| 91 |
* @return bool False. |
| 92 |
*/ |
| 93 |
function wp_enqueue_webfont() { |
| 94 |
_deprecated_function( __FUNCTION__, 'Gutenberg 14.9.1' ); |
| 95 |
return false; |
| 96 |
} |
| 97 |
} |
| 98 |
|
| 99 |
if ( ! function_exists( 'wp_enqueue_webfont_variations' ) ) { |
| 100 |
/** |
| 101 |
* Enqueues a specific set of web font variations. |
| 102 |
* |
| 103 |
* @since X.X.X |
| 104 |
* @deprecated 15.1 Use wp_enqueue_font_variations() instead. |
| 105 |
* @deprecated 16.3.0 No longer functional. Do not use. |
| 106 |
*/ |
| 107 |
function wp_enqueue_webfont_variations() { |
| 108 |
_deprecated_function( __FUNCTION__, 'Gutenberg 15.1' ); |
| 109 |
} |
| 110 |
} |
| 111 |
|
| 112 |
if ( ! function_exists( 'wp_deregister_webfont_variation' ) ) { |
| 113 |
/** |
| 114 |
* Deregisters a font variation. |
| 115 |
* |
| 116 |
* @since 14.9.1 |
| 117 |
* @deprecated 15.1 Use wp_deregister_font_variation() instead. |
| 118 |
* @deprecated 16.3.0 Deregister is not supported. |
| 119 |
*/ |
| 120 |
function wp_deregister_webfont_variation() { |
| 121 |
_deprecated_function( __FUNCTION__, 'Gutenberg 15.1' ); |
| 122 |
} |
| 123 |
} |
| 124 |
|
| 125 |
if ( ! function_exists( 'wp_get_webfont_providers' ) ) { |
| 126 |
/** |
| 127 |
* Gets all registered providers. |
| 128 |
* |
| 129 |
* @since X.X.X |
| 130 |
* @deprecated 14.9.1 Use wp_fonts()->get_providers(). |
| 131 |
* @deprecated 16.3.0 Providers are not supported. |
| 132 |
* |
| 133 |
* @return array Empty array. |
| 134 |
*/ |
| 135 |
function wp_get_webfont_providers() { |
| 136 |
_deprecated_function( __FUNCTION__, '14.9.1' ); |
| 137 |
|
| 138 |
return array(); |
| 139 |
} |
| 140 |
} |
| 141 |
|
| 142 |
if ( ! function_exists( 'wp_register_webfont_provider' ) ) { |
| 143 |
/** |
| 144 |
* Registers a custom font service provider. |
| 145 |
* |
| 146 |
* @since X.X.X |
| 147 |
* @deprecated 15.1 Use wp_register_font_provider() instead. |
| 148 |
* @deprecated 16.3.0 Providers are not supported. |
| 149 |
* |
| 150 |
* @return bool False. |
| 151 |
*/ |
| 152 |
function wp_register_webfont_provider() { |
| 153 |
_deprecated_function( __FUNCTION__, 'GB 15.1', 'wp_register_font_provider' ); |
| 154 |
return false; |
| 155 |
} |
| 156 |
} |
| 157 |
|
| 158 |
if ( ! function_exists( 'wp_print_webfonts' ) ) { |
| 159 |
/** |
| 160 |
* Invokes each provider to process and print its styles. |
| 161 |
* |
| 162 |
* @since 14.9.1 |
| 163 |
* @deprecated 15.1 Use wp_print_fonts() instead. |
| 164 |
* @deprecated 16.3.0 Webfonts API is not supported. |
| 165 |
* |
| 166 |
* @return array Empty array. |
| 167 |
*/ |
| 168 |
function wp_print_webfonts() { |
| 169 |
_deprecated_function( __FUNCTION__, 'Gutenberg 15.1', 'wp_print_font_faces' ); |
| 170 |
return array(); |
| 171 |
} |
| 172 |
} |
| 173 |
|
| 174 |
if ( ! function_exists( 'wp_fonts' ) ) { |
| 175 |
/** |
| 176 |
* Initialize $wp_fonts if it has not been set. |
| 177 |
* |
| 178 |
* @since X.X.X |
| 179 |
* @deprecated 16.3.0 Use Font Library and Font Face. Fonts API is not supported. |
| 180 |
* |
| 181 |
* @global WP_Fonts $wp_fonts |
| 182 |
* |
| 183 |
* @return WP_Fonts WP_Fonts instance. |
| 184 |
*/ |
| 185 |
function wp_fonts() { |
| 186 |
_deprecated_function( __FUNCTION__, 'Gutenberg 16.3' ); |
| 187 |
|
| 188 |
global $wp_fonts; |
| 189 |
|
| 190 |
if ( ! ( $wp_fonts instanceof WP_Fonts ) ) { |
| 191 |
$wp_fonts = new WP_Fonts(); |
| 192 |
} |
| 193 |
|
| 194 |
return $wp_fonts; |
| 195 |
} |
| 196 |
} |
| 197 |
|
| 198 |
if ( ! function_exists( 'wp_register_fonts' ) ) { |
| 199 |
/** |
| 200 |
* Registers one or more font-families and each of their variations. |
| 201 |
* |
| 202 |
* @since X.X.X |
| 203 |
* @deprecated 16.3.0 Register is not supported. |
| 204 |
* |
| 205 |
* @return array Empty array. |
| 206 |
*/ |
| 207 |
function wp_register_fonts() { |
| 208 |
_deprecated_function( __FUNCTION__, 'Gutenberg 16.3' ); |
| 209 |
return array(); |
| 210 |
} |
| 211 |
} |
| 212 |
|
| 213 |
if ( ! function_exists( 'wp_enqueue_fonts' ) ) { |
| 214 |
/** |
| 215 |
* Enqueues one or more font family and all of its variations. |
| 216 |
* |
| 217 |
* @since X.X.X |
| 218 |
* @deprecated 16.3.0 Enqueue is not supported. |
| 219 |
*/ |
| 220 |
function wp_enqueue_fonts() { |
| 221 |
_deprecated_function( __FUNCTION__, 'Gutenberg 16.3' ); |
| 222 |
} |
| 223 |
} |
| 224 |
|
| 225 |
if ( ! function_exists( 'wp_enqueue_font_variations' ) ) { |
| 226 |
/** |
| 227 |
* Enqueues a specific set of font variations. |
| 228 |
* |
| 229 |
* @since X.X.X |
| 230 |
* @deprecated 16.3.0 Enqueue is not supported. |
| 231 |
*/ |
| 232 |
function wp_enqueue_font_variations() { |
| 233 |
_deprecated_function( __FUNCTION__, 'Gutenberg 16.3' ); |
| 234 |
} |
| 235 |
} |
| 236 |
|
| 237 |
if ( ! function_exists( 'wp_deregister_font_family' ) ) { |
| 238 |
/** |
| 239 |
* Deregisters a font family and all of its registered variations. |
| 240 |
* |
| 241 |
* @since X.X.X |
| 242 |
* @deprecated 16.3.0 Deregister is not supported. |
| 243 |
*/ |
| 244 |
function wp_deregister_font_family() { |
| 245 |
_deprecated_function( __FUNCTION__, 'Gutenberg 16.3' ); |
| 246 |
} |
| 247 |
} |
| 248 |
|
| 249 |
if ( ! function_exists( 'wp_deregister_font_variation' ) ) { |
| 250 |
/** |
| 251 |
* Deregisters a font variation. |
| 252 |
* |
| 253 |
* @since X.X.X |
| 254 |
* @deprecated 16.3.0 Deregister is not supported. |
| 255 |
*/ |
| 256 |
function wp_deregister_font_variation() { |
| 257 |
_deprecated_function( __FUNCTION__, 'Gutenberg 16.3' ); |
| 258 |
} |
| 259 |
} |
| 260 |
|
| 261 |
if ( ! function_exists( 'wp_register_font_provider' ) ) { |
| 262 |
/** |
| 263 |
* Registers a custom font service provider. |
| 264 |
* |
| 265 |
* @since X.X.X |
| 266 |
* @deprecated 16.3.0 Providers are not supported. |
| 267 |
* |
| 268 |
* @return bool False. |
| 269 |
*/ |
| 270 |
function wp_register_font_provider() { |
| 271 |
_deprecated_function( __FUNCTION__, 'Gutenberg 16.3' ); |
| 272 |
return false; |
| 273 |
} |
| 274 |
} |
| 275 |
|
| 276 |
if ( ! function_exists( 'wp_print_fonts' ) ) { |
| 277 |
/** |
| 278 |
* Invokes each provider to process and print its styles. |
| 279 |
* |
| 280 |
* @since X.X.X |
| 281 |
* @deprecated 16.3.0 For classic themes, use wp_print_font_faces(). For all other sites, |
| 282 |
* Font Face will automatically print all fonts in theme.json merged data layer, |
| 283 |
* including in theme and user activated fonts from the Font Library. |
| 284 |
* |
| 285 |
* @return array Empty array. |
| 286 |
*/ |
| 287 |
function wp_print_fonts() { |
| 288 |
_deprecated_function( __FUNCTION__, 'Gutenberg 16.3', 'wp_print_font_faces' ); |
| 289 |
return array(); |
| 290 |
} |
| 291 |
} |
| 292 |
|