mirror of
https://github.com/WenPai-org/wpfonts.git
synced 2025-08-03 19:19:52 +08:00
Update wpfonts.php
This commit is contained in:
parent
58b1ba2050
commit
ef1a80114c
1 changed files with 41 additions and 43 deletions
42
wpfonts.php
42
wpfonts.php
|
@ -13,16 +13,15 @@
|
|||
* Domain Path: /languages
|
||||
*/
|
||||
|
||||
|
||||
// Load text domain
|
||||
function wp_fonts_text_domain() {
|
||||
load_plugin_textdomain('wp-fonts', false, dirname(plugin_basename(__FILE__)) . '/languages');
|
||||
function wp_fonts_load_textdomain() {
|
||||
load_plugin_textdomain('wpfonts', false, dirname(plugin_basename(__FILE__)) . '/languages');
|
||||
}
|
||||
add_action('init', 'wp_fonts_text_domain');
|
||||
add_action('plugins_loaded', 'wp_fonts_load_textdomain');
|
||||
|
||||
// Register Font Collection
|
||||
if (function_exists('wp_register_font_collection')) {
|
||||
function wenpai_register_wp_fonts() {
|
||||
function wp_fonts_register_collections() {
|
||||
$categories = array(
|
||||
array(
|
||||
'slug' => 'sans-serif',
|
||||
|
@ -42,38 +41,37 @@ if ( function_exists( 'wp_register_font_collection' ) ) {
|
|||
)
|
||||
);
|
||||
|
||||
$font_collection_cn = array(
|
||||
// Chinese Font Collection
|
||||
wp_register_font_collection('wp-fonts-stacks-cn', array(
|
||||
'name' => __('Chinese', 'wpfonts'),
|
||||
'description' => __('Cross-platform Chinese system font stacks. Automatically adapt to Windows/macOS/Linux fonts.', 'wpfonts'),
|
||||
'categories' => $categories,
|
||||
'font_families' => path_join(__DIR__, 'collection/chinese.json'),
|
||||
);
|
||||
wp_register_font_collection('wp-fonts-stacks-cn', $font_collection_cn);
|
||||
));
|
||||
|
||||
$font_collection_en = array(
|
||||
// English Font Collection
|
||||
wp_register_font_collection('wp-fonts-stacks-en', array(
|
||||
'name' => __('English', 'wpfonts'),
|
||||
'description' => __('Stacks of modern systems fonts, no font files needed. The look will vary on each system.', 'wpfonts'),
|
||||
'description' => __('Stacks of modern system fonts, no font files needed. The look will vary on each system.', 'wpfonts'),
|
||||
'categories' => $categories,
|
||||
'font_families' => path_join(__DIR__, 'collection/english.json'),
|
||||
);
|
||||
wp_register_font_collection('wp-fonts-stacks-en', $font_collection_en);
|
||||
));
|
||||
|
||||
$font_collection_jp = array(
|
||||
// Japanese Font Collection
|
||||
wp_register_font_collection('wp-fonts-stacks-jp', array(
|
||||
'name' => __('Japanese', 'wpfonts'),
|
||||
'description' => __('Japanese system font stacks with optimized kana rendering', 'wpfonts'),
|
||||
'description' => __('Japanese system font stacks with optimized kana rendering.', 'wpfonts'),
|
||||
'categories' => $categories,
|
||||
'font_families' => path_join(__DIR__, 'collection/japanese.json'),
|
||||
);
|
||||
wp_register_font_collection('wp-fonts-stacks-jp', $font_collection_jp);
|
||||
));
|
||||
|
||||
$font_collection_kr = array(
|
||||
// Korean Font Collection
|
||||
wp_register_font_collection('wp-fonts-stacks-kr', array(
|
||||
'name' => __('Korean', 'wpfonts'),
|
||||
'description' => __('Hangul-optimized font stacks for Korean content', 'wpfonts'),
|
||||
'description' => __('Hangul-optimized font stacks for Korean content.', 'wpfonts'),
|
||||
'categories' => $categories,
|
||||
'font_families' => path_join(__DIR__, 'collection/korean.json'),
|
||||
);
|
||||
wp_register_font_collection('wp-fonts-stacks-kr', $font_collection_kr);
|
||||
));
|
||||
}
|
||||
|
||||
add_action('init', 'wenpai_register_wp_fonts');
|
||||
add_action('init', 'wp_fonts_register_collections');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue