Skip to content

Commit

Permalink
Fix wp_register_webfont description
Browse files Browse the repository at this point in the history
  • Loading branch information
zaguiini committed Mar 23, 2022
1 parent 5efc13d commit 99521d4
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions lib/compat/wordpress-6.0/webfonts.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,16 @@ function wp_webfonts() {
* array(
* array(
* 'provider' => 'local',
* 'font_family' => 'Source Serif Pro',
* 'font_weight' => '200 900',
* 'font_style' => 'normal',
* 'font-family' => 'Source Serif Pro',
* 'font-weight' => '200 900',
* 'font-style' => 'normal',
* 'src' => get_theme_file_uri( 'assets/fonts/source-serif-pro/SourceSerif4Variable-Roman.ttf.woff2' ),
* ),
* array(
* 'provider' => 'local',
* 'font_family' => 'Source Serif Pro',
* 'font_weight' => '200 900',
* 'font_style' => 'italic',
* 'font-family' => 'Source Serif Pro',
* 'font-weight' => '200 900',
* 'font-style' => 'italic',
* 'src' => get_theme_file_uri( 'assets/fonts/source-serif-pro/SourceSerif4Variable-Italic.ttf.woff2' ),
* ),
* )
Expand All @@ -61,8 +61,6 @@ function wp_webfonts() {
* @param array $webfonts Webfonts to be registered.
* This contains an array of webfonts to be registered.
* Each webfont is an array.
* See {@see WP_Webfonts_Registry::register()} for a list of
* supported arguments for each webfont.
*/
function wp_register_webfonts( array $webfonts = array() ) {
foreach ( $webfonts as $webfont ) {
Expand All @@ -76,22 +74,22 @@ function wp_register_webfonts( array $webfonts = array() ) {
* Example of how to register Source Serif Pro font with font-weight range of 200-900:
*
* If the font file is contained within the theme:
* ```
*
* <code>
* wp_register_webfont(
* array(
* 'provider' => 'local',
* 'font_family' => 'Source Serif Pro',
* 'font_weight' => '200 900',
* 'font_style' => 'normal',
* 'font-family' => 'Source Serif Pro',
* 'font-weight' => '200 900',
* 'font-style' => 'normal',
* 'src' => get_theme_file_uri( 'assets/fonts/source-serif-pro/SourceSerif4Variable-Roman.ttf.woff2' ),
* )
* );
* ```
* </code>
*
* @since 6.0.0
*
* @param array $webfont Webfont to be registered.
* See {@see WP_Webfonts_Registry::register()} for a list of supported arguments.
*/
function wp_register_webfont( array $webfont ) {
wp_webfonts()->register_font( $webfont );
Expand Down

0 comments on commit 99521d4

Please sign in to comment.