Add new google fonts to Visual Composer Custom Heading
✓ Published0🌍 Public
KKopylovVitalik
Last edited Sep 19, 2016
Created on Jul 18, 2020
This example shows how to extend Visual Composer’s built-in Google Fonts list by registering a custom font family through a WordPress filter. The code defines a `helper_vc_fonts` function that constructs a font object with properties like `font_family`, `font_types`, and `font_styles`, then appends it to the existing `$fonts_list` array. It relies on the `vc_google_fonts_get_fonts_filter` hook and the `esc_html_e` localization function. The implementation uses PHP only, with no JavaScript libraries, and returns the modified list to add Poppins with multiple weights to the editor’s font selector.
AI-generated description