Skip to content

Commit

Permalink
Merge pull request #3 from matiasbenedetto/update/6.5-beta2
Browse files Browse the repository at this point in the history
Accommodate changes from core 6.5 beta 2
  • Loading branch information
matiasbenedetto committed Feb 23, 2024
2 parents 3195aa0 + 52dda9c commit 041b402
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 24 deletions.
20 changes: 0 additions & 20 deletions collection.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,5 @@
{
"$schema": "https://schemas.wp.org/trunk/font-collection.json",
"name": "Modern Fonts Stacks",
"description": "Stacks of modern systems fonts, not font face assets needed. The look will vary on each system.",
"categories": [
{
"slug": "sans-serif",
"name": "Sans Serif"
},
{
"slug": "serif",
"name": "Serif"
},
{
"slug": "monospace",
"name": "Monospace"
},
{
"slug": "handwriting",
"name": "Handwriting"
}
],
"font_families": [
{
"font_family_settings": {
Expand Down
33 changes: 29 additions & 4 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,44 @@
Plugin Name: Modern Fonts Stacks
Plugin URI: https://github.com/matiasbenedetto/modern-fonts-stacks-for-wp-font-library/
Description: Add a font collection to your WordPress Font Library.
Version: 0.0.4
Version: 0.0.5
Author: Matias Benedetto
Author URI: https://wordpress.org/
License: GPLv2 or later
Text Domain: modern-fonts-stacks-for-wp-font-library
*/

if ( function_exists( 'wp_register_font_collection' ) ) {

function register_modern_fonts_stacks() {
wp_register_font_collection ( 'modern-fonts-stacks', path_join( __DIR__, 'collection.json' ) );
$categories = array(
array(
"slug" => "sans-serif",
"name" => "Sans Serif"
),
array(
"slug" => "serif",
"name" => "Serif"
),
array(
"slug" => "monospace",
"name" => "Monospace"
),
array(
"slug" => "handwriting",
"name" => "Handwriting"
)
);

$font_collection = array(
'name' => __( 'Modern Fonts Stacks' ),
'description' => __( 'Stacks of modern systems fonts, not font face assets needed. The look will vary on each system.' ),
'categories' => $categories,
'font_families' => path_join( __DIR__, 'collection.json' ),
);

wp_register_font_collection( 'modern-fonts-stacks', $font_collection );
}

add_action( 'init', 'register_modern_fonts_stacks' );

}

0 comments on commit 041b402

Please sign in to comment.