inc2734 / wp-google-fonts
Installs: 3 075
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Requires
- php: >=5.6
Requires (Dev)
This package is auto-updated.
Last update: 2022-05-27 00:37:59 UTC
README
Install
$ composer require inc2734/wp-google-fonts
How to use
<?php
new \Inc2734\WP_Google_Fonts\Bootstrap();
// Enqueue Noto Sans JP
add_action( 'wp_enqueue_scripts', [ '\Inc2734\WP_Google_Fonts\Helper', 'enqueue_noto_sans_jp' ], 5 );
add_action( 'enqueue_block_editor_assets', [ '\Inc2734\WP_Google_Fonts\Helper', 'enqueue_noto_sans_jp' ] );
// Noto Serif JP
add_action( 'wp_enqueue_scripts', [ '\Inc2734\WP_Google_Fonts\Helper', 'enqueue_noto_serif_jp' ], 5 );
add_action( 'enqueue_block_editor_assets', [ '\Inc2734\WP_Google_Fonts\Helper', 'enqueue_noto_serif_jp' ] );
Filter hooks
inc2734_wp_google_fonts_font_weight
/**
* @param string $weight 400:700
* @return string
*/
add_filter(
'inc2734_wp_google_fonts_font_weight',
function( $weight ) {
return $weight;
}
);