| 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 |
|