PluginProbe
Gutenberg / 17.2.1
Gutenberg v17.2.1
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 / fonts-api / bc-layer / class-wp-webfonts-provider.php

class-wp-webfonts-provider.php in Gutenberg 17.2.1, at lib/experimental/fonts-api/bc-layer/class-wp-webfonts-provider.php

67 lines 1.6 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 * 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