matgargano / gutenberg-font-family
Gutenberg Font Family
Installs: 2
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Language:JavaScript
Type:wordpress-plugin
pkg:composer/matgargano/gutenberg-font-family
Requires
- php: >=7.4
README
A WordPress plugin that adds a Font Family dropdown to Gutenberg blocks.
Description
This plugin adds a toolbar dropdown to select font families on supported Gutenberg blocks. When selected, a CSS class is applied to the block for styling.
Supported Blocks
- Paragraph
- Heading
- List
- Quote
- Pullquote
Installation
- Upload the
gutenberg-font-familyfolder to/wp-content/plugins/ - Activate the plugin through the WordPress admin
- Edit any page/post and select a supported block to see the Font dropdown in the toolbar
Usage
- Edit a page or post in Gutenberg
- Select a paragraph, heading, list, quote, or pullquote block
- Click the "Font" dropdown in the block toolbar
- Select a font family option
Customization
Filter the available font options using the gutenberg_font_family_options filter:
add_filter('gutenberg_font_family_options', function ($options) { return array( 'font-heading' => 'Heading', 'font-body' => 'Body', 'font-custom' => 'Custom Font', ); });
The array keys are CSS class names applied to the block, and values are the labels shown in the dropdown.
Version
0.0.1
License
GPL-2.0-or-later