| 1 |
<?php |
| 2 |
/** |
| 3 |
* Fonts API: Provider abstract class. |
| 4 |
* |
| 5 |
* Part of the backwards-compatibility (BC) layer for all |
| 6 |
* deprecated publicly exposed methods and functionality. |
| 7 |
* |
| 8 |
* This class/file will NOT be backported to Core. Rather for sites |
| 9 |
* using the previous API, it exists to prevent breakages, giving |
| 10 |
* developers time to upgrade their code. |
| 11 |
* |
| 12 |
* @package WordPress |
| 13 |
* @subpackage Fonts API |
| 14 |
* @since X.X.X |
| 15 |
*/ |
| 16 |
|
| 17 |
if ( class_exists( 'WP_Webfonts_Provider' ) ) { |
| 18 |
return; |
| 19 |
} |
| 20 |
|
| 21 |
/** |
| 22 |
* Deprecated abstract class for Fonts API providers. |
| 23 |
* |
| 24 |
* BACKPORT NOTE: Do not backport this file to Core. |
| 25 |
* |
| 26 |
* @since X.X.X |
| 27 |
* @deprecated GB 15.1 Use `WP_Fonts_Provider` instead. |
| 28 |
*/ |
| 29 |
abstract class WP_Webfonts_Provider extends WP_Fonts_Provider { |
| 30 |
|
| 31 |
/** |
| 32 |
* Fonts to be processed. |
| 33 |
* |
| 34 |
* @since X.X.X |
| 35 |
* @deprecated GB 15.1 Use WP_Fonts_Provider::$fonts property instead. |
| 36 |
* |
| 37 |
* @var array[] |
| 38 |
*/ |
| 39 |
protected $webfonts = array(); |
| 40 |
|
| 41 |
/** |
| 42 |
* Sets this provider's fonts property. |
| 43 |
* |
| 44 |
* @since X.X.X |
| 45 |
* @deprecated GB 15.1 Use WP_Fonts_Provider::set_fonts() instead. |
| 46 |
* |
| 47 |
* @param array[] $fonts Fonts to be processed. |
| 48 |
*/ |
| 49 |
public function set_webfonts( array $fonts ) { |
| 50 |
_deprecated_function( __METHOD__, 'X.X.X', 'WP_Fonts_Provider::set_fonts()' ); |
| 51 |
|
| 52 |
parent::set_fonts( $fonts ); |
| 53 |
$this->webfonts = $this->fonts; |
| 54 |
} |
| 55 |
|
| 56 |
/** |
| 57 |
* This method is here to wire WP_Fonts_Provider::do_item() to this |
| 58 |
* deprecated class to ensure the fonts get set. |
| 59 |
* |
| 60 |
* @param array[] $fonts Fonts to be processed. |
| 61 |
*/ |
| 62 |
public function set_fonts( array $fonts ) { |
| 63 |
parent::set_fonts( $fonts ); |
| 64 |
$this->webfonts = $this->fonts; |
| 65 |
} |
| 66 |
} |
| 67 |
|