Created
October 4, 2017 06:19
-
-
Save merianos/da341f38b87bcbbbe2bb1048404748fa to your computer and use it in GitHub Desktop.
Custom font family in the Fonts control of the Elementor page builder after the version 1.7.10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// After the Elementor update to 1.7.10, the fonts list has change in the | |
// control settings from `fonts` to `options`. | |
// | |
// Thus for version after 1.7.10 we should use the following code for retrive | |
// and set the new font families. | |
$fonts = $controls_registry->get_control( 'font' )->get_settings( 'options' ); | |
// Register here the custom font families | |
$controls_registry->get_control( 'font' )->set_settings( 'options', $new_fonts ); |
FWIW I added my fonts directly in fonts.php and elementor picked it up.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Can you write an example of how to register the custom font?
Let's say i have a font.ttf file and upload it to my direcotry.
I put the code in functions.php
Where i register the path to font.ttf on that code?