/** * Register front css styles. * * Calls wp_register_style for required css libraries files. * * @since 3.1 * @access public */ public function frontCss() { wp_register_style('isotope-css', vc_asset_url('css/lib/isotope.css'), false, WPB_VC_VERSION, 'all'); $front_css_file = vc_asset_url('css/js_composer.css'); $upload_dir = wp_upload_dir(); if (vc_settings()->get('use_custom') == '1' && is_file($upload_dir['basedir'] . '/' . vc_upload_dir() . '/js_composer_front_custom.css')) { $front_css_file = $upload_dir['baseurl'] . '/' . vc_upload_dir() . '/js_composer_front_custom.css'; // fix @since 4.4, todo review it. $front_css_file = str_replace(array('http://', 'https://'), '//', $front_css_file); } wp_register_style('js_composer_front', $front_css_file, false, WPB_VC_VERSION, 'all'); $custom_css_path = $upload_dir['basedir'] . '/' . vc_upload_dir() . '/custom.css'; if (is_file($upload_dir['basedir'] . '/' . vc_upload_dir() . '/custom.css')) { $custom_css_url = $upload_dir['baseurl'] . '/' . vc_upload_dir() . '/custom.css'; // @todo fix file_get_content() if (strlen(trim(vc_file_get_contents($custom_css_path))) > 0) { $custom_css_url = str_replace(array('http://', 'https://'), '//', $custom_css_url); wp_register_style('js_composer_custom_css', $custom_css_url, array(), WPB_VC_VERSION, 'screen'); } } add_action('wp_enqueue_scripts', array(&$this, 'enqueueStyle')); /** * @since 4.4 */ do_action('vc_base_register_front_css'); // add_action( 'wp_head', array( &$this, 'addShortcodesCustomCss' ), 1000 ); }
/** * Register front css styles. * * Calls wp_register_style for required css libraries files. * * @since 3.1 * @access public */ public function frontCss() { wp_register_style('flexslider', vc_asset_url('lib/bower/flexslider/flexslider.css'), false, WPB_VC_VERSION, 'screen'); wp_register_style('nivo-slider-css', vc_asset_url('lib/bower/nivoslider/nivo-slider.css'), false, WPB_VC_VERSION, 'screen'); wp_register_style('nivo-slider-theme', vc_asset_url('lib/bower/nivoslider/themes/default/default.css'), array('nivo-slider-css'), WPB_VC_VERSION, 'screen'); wp_register_style('prettyphoto', vc_asset_url('lib/prettyphoto/css/prettyPhoto.css'), false, WPB_VC_VERSION, 'screen'); wp_register_style('isotope-css', vc_asset_url('css/lib/isotope.css'), false, WPB_VC_VERSION, 'all'); wp_register_style('font-awesome', vc_asset_url('lib/bower/font-awesome/css/font-awesome.min.css'), false, WPB_VC_VERSION, 'screen'); $front_css_file = vc_asset_url('css/js_composer.min.css'); $upload_dir = wp_upload_dir(); if ('1' === vc_settings()->get('use_custom') && is_file($upload_dir['basedir'] . '/' . vc_upload_dir() . '/js_composer_front_custom.css')) { $front_css_file = $upload_dir['baseurl'] . '/' . vc_upload_dir() . '/js_composer_front_custom.css'; // fix @since 4.4, TODO: review it. $front_css_file = str_replace(array('http://', 'https://'), '//', $front_css_file); } wp_register_style('js_composer_front', $front_css_file, false, WPB_VC_VERSION, 'all'); $custom_css_path = $upload_dir['basedir'] . '/' . vc_upload_dir() . '/custom.css'; if (is_file($upload_dir['basedir'] . '/' . vc_upload_dir() . '/custom.css')) { $custom_css_url = $upload_dir['baseurl'] . '/' . vc_upload_dir() . '/custom.css'; // TODO: fix file_get_content() if (strlen(trim(vc_file_get_contents($custom_css_path))) > 0) { $custom_css_url = str_replace(array('http://', 'https://'), '//', $custom_css_url); wp_register_style('js_composer_custom_css', $custom_css_url, array(), WPB_VC_VERSION, 'screen'); } } add_action('wp_enqueue_scripts', array(&$this, 'enqueueStyle')); /** * @since 4.4 */ do_action('vc_base_register_front_css'); }