Snippets: Custom Google Font Lists

Using a filter you can select which Google Fonts are available when selecting fonts in the Customizer or in Visual Composer page builder modules. So instead of loading hundreds of options you can load only the ones you will be using on the site.

function myprefix_google_fonts( $array ) {
    return array( 'Open Sans', 'Roboto', 'Source Sans Pro' );
}
add_filter( 'wpex_google_fonts_array', 'myprefix_google_fonts' );
All PHP snippets should be added via a child theme's functions.php file.