public function get_all_fonts() { $fonts = Nova()->font_registry->get_all_fonts(); $fonts_array = array(); foreach ($fonts as $key => $font) { if (is_array($font)) { if (isset($font['label'])) { if (isset($font['stack'])) { $fonts_array[$font['stack']] = $font['label']; } else { $fonts_array[$key] = $font['label']; } } else { $fonts_array[$key] = $key; } } else { $fonts_array[$key] = $font; } } return $fonts_array; }
function Nova() { // Make sure the class is instanciated $nova = Nova_Toolkit::get_instance(); $nova->font_registry = new Nova_Google_Fonts_Registry(); $nova->api = new Nova(); $nova->scripts = new Nova_Scripts_Registry(); $nova->styles = array('back' => new Nova_Styles_Customizer(), 'front' => new Nova_Styles_Frontend()); /** * The path of the current Nova instance */ Nova::$path = dirname(__FILE__); return $nova; } global $nova; $nova = Nova(); } /** * Apply the filters to the Nova::$url */ if (!function_exists('nova_filtered_url')) { function nova_filtered_url() { $config = apply_filters('nova/config', array()); if (isset($config['url_path'])) { Nova::$url = esc_url_raw($config['url_path']); } } add_action('after_setup_theme', 'nova_filtered_url'); } include_once Nova::$path . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'deprecated.php';