Add Custom Fonts to Font Family Dropdown List

This feature enables users to incorporate their custom fonts into GB’s font family dropdown list. Kindly note that before utilizing this filter to include fonts in GB’s dropdown list, they must be either installed or linked to your website.

add_filter(
    'generateblocks_typography_font_family_list',
    function( $fonts ) {
        $fonts[] = [
            'label' => 'My custom fonts',
            'options' => [
                [
                    'label' => 'My cool font',
                    'value' => 'My cool font',
                ],
                [
                    'label' => 'Another font',
                    'value' => 'Another font',
                ],
            ],
        ];
		
        return $fonts;
    }
);

As a result, you’ll have the option to select from the two custom fonts we’ve just added to the dropdown list.