function add_styles()
 {
     wp_enqueue_style('upfront-main', upfront_ajax_url('upfront_load_styles'), array(), Upfront_ChildTheme::get_version(), 'all');
     $deps = Upfront_CoreDependencies_Registry::get_instance();
     // Load theme fonts
     $theme_fonts = json_decode(get_option('upfront_' . get_stylesheet() . '_theme_fonts'));
     $theme_fonts = apply_filters('upfront_get_theme_fonts', $theme_fonts, array());
     if ($theme_fonts) {
         foreach ($theme_fonts as $theme_font) {
             /*
             wp_enqueue_style(
             	strtolower(str_replace(' ', '-', $theme_font->font->family)) . '-' . $theme_font->variant,
             	'//fonts.googleapis.com/css?family=' . str_replace(' ', '+', $theme_font->font->family) . ':' . $theme_font->variant,
             	array(),
             	Upfront_ChildTheme::get_version()
             );
             */
             $deps->add_font($theme_font->font->family, $theme_font->variant);
         }
     }
     // The dependencies server will manage the fonts.
 }
 private function _get_enqueue_version()
 {
     return Upfront_ChildTheme::get_version();
 }
Beispiel #3
0
 function inject_global_dependencies()
 {
     $deps = Upfront_CoreDependencies_Registry::get_instance();
     wp_enqueue_script('jquery');
     //Basic styles for upfront to work are always loaded.
     wp_enqueue_style('upfront-global', self::get_root_url() . '/styles/global.css', array(), Upfront_ChildTheme::get_version());
     if (!Upfront_Permissions::current(Upfront_Permissions::BOOT)) {
         // Don't queue the front grid if has permission to boot Upfront, queue editor grid instead
         wp_enqueue_style('upfront-front-grid', admin_url('admin-ajax.php?action=upfront_load_grid'), array(), Upfront_ChildTheme::get_version());
     }
     if (Upfront_Permissions::current(Upfront_Permissions::BOOT)) {
         do_action('upfront-core-wp_dependencies');
         wp_enqueue_style('upfront-editor-interface', self::get_root_url() . '/styles/editor-interface.css', array(), Upfront_ChildTheme::get_version());
         $link_urls = array(admin_url('admin-ajax.php?action=upfront_load_editor_grid'), self::get_root_url() . '/scripts/chosen/chosen.min.css', self::get_root_url() . '/styles/font-icons.css');
         foreach ($link_urls as $url) {
             $deps->add_style($url);
         }
         $deps->add_font('Source Sans Pro', array('400', '600', '700', '400italic', '600italic', '700italic'));
         add_action('wp_footer', array($this, 'add_responsive_css'));
     }
 }