Exemplo n.º 1
0
function vc_page_settings_tab_color_submit_attributes($submitButtonAttributes)
{
    $submitButtonAttributes['data-vc-less-path'] = vc_str_remove_protocol(vc_asset_url('less/js_composer.less'));
    $submitButtonAttributes['data-vc-less-root'] = vc_str_remove_protocol(vc_asset_url('less'));
    $submitButtonAttributes['data-vc-less-variables'] = json_encode(apply_filters('vc_settings-less-variables', array('vc_grey' => array('key' => 'wpb_js_vc_color', 'default' => vc_settings()->getDefault('vc_color')), 'vc_grey_hover' => array('key' => 'wpb_js_vc_color_hover', 'default' => vc_settings()->getDefault('vc_color_hover')), 'vc_image_slider_link_active' => 'wpb_js_vc_color_hover', 'vc_call_to_action_bg' => 'wpb_js_vc_color_call_to_action_bg', 'vc_call_to_action_2_bg' => 'wpb_js_vc_color_call_to_action_bg', 'vc_call_to_action_border' => array('key' => 'wpb_js_vc_color_call_to_action_border', 'default_key' => 'wpb_js_vc_color', 'modify_output' => array(array('plain' => array('darken({{ value }}, 5%)')))), 'vc_google_maps_bg' => 'wpb_js_vc_color_google_maps_bg', 'vc_post_slider_caption_bg' => 'wpb_js_vc_color_post_slider_caption_bg', 'vc_progress_bar_bg' => 'wpb_js_vc_color_progress_bar_bg', 'vc_separator_border' => 'wpb_js_vc_color_separator_border', 'vc_tab_bg' => 'wpb_js_vc_color_tab_bg', 'vc_tab_bg_active' => 'wpb_js_vc_color_tab_bg_active', 'vc_element_margin_bottom' => array('key' => 'wpb_js_margin', 'default' => vc_settings()->getDefault('margin')), 'grid-gutter-width' => array('key' => 'wpb_js_gutter', 'default' => vc_settings()->getDefault('gutter'), 'modify_output' => array(array('plain' => array('{{ value }}px')))), 'screen-sm-min' => array('key' => 'wpb_js_responsive_max', 'default' => vc_settings()->getDefault('responsive_max'), 'modify_output' => array(array('plain' => array('{{ value }}px')))))));
    return $submitButtonAttributes;
}
Exemplo n.º 2
0
 /**
  * vc_filter: vc_frontend_editor_iframe_url - hook to edit iframe url, can be used in vendors like qtranslate do.
  */
 function renderEditor()
 {
     global $current_user;
     get_currentuserinfo();
     $this->current_user = $current_user;
     $this->post_url = vc_str_remove_protocol(get_permalink($this->post_id));
     if (!self::inlineEnabled() || !vc_user_access()->wpAny(array('edit_post', $this->post_id))->get()) {
         header('Location: ' . $this->post_url);
     }
     $this->registerJs();
     $this->registerCss();
     visual_composer()->registerAdminCss();
     //bc
     visual_composer()->registerAdminJavascript();
     //bc
     if ($this->post && 'auto-draft' === $this->post->post_status) {
         $post_data = array('ID' => $this->post_id, 'post_status' => 'draft', 'post_title' => '');
         add_filter('wp_insert_post_empty_content', array($this, 'allowInsertEmptyPost'));
         wp_update_post($post_data, true);
         $this->post->post_status = 'draft';
         $this->post->post_title = '';
     }
     add_filter('admin_body_class', array($this, 'filterAdminBodyClass'));
     $this->post_type = get_post_type_object($this->post->post_type);
     $this->url = $this->post_url . (preg_match('/\\?/', $this->post_url) ? '&' : '?') . 'vc_editable=true&vc_post_id=' . $this->post->ID . '&_vcnonce=' . vc_generate_nonce('vc-admin-nonce');
     $this->url = apply_filters('vc_frontend_editor_iframe_url', $this->url);
     $this->enqueueAdmin();
     $this->enqueueMappedShortcode();
     wp_enqueue_media(array('post' => $this->post_id));
     remove_all_actions('admin_notices', 3);
     remove_all_actions('network_admin_notices', 3);
     $post_custom_css = strip_tags(get_post_meta($this->post_id, '_wpb_post_custom_css', true));
     $this->post_custom_css = $post_custom_css;
     if (!defined('IFRAME_REQUEST')) {
         define('IFRAME_REQUEST', true);
     }
     /**
      * @deprecated vc_admin_inline_editor action hook
      */
     do_action('vc_admin_inline_editor');
     /**
      * new one
      */
     do_action('vc_frontend_editor_render');
     add_filter('admin_title', array(&$this, 'setEditorTitle'));
     $this->render('editor');
     die;
 }
Exemplo n.º 3
0
 /**
  * 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.min.css'), array(), WPB_VC_VERSION);
     wp_register_style('nivo-slider-css', vc_asset_url('lib/bower/nivoslider/nivo-slider.min.css'), array(), WPB_VC_VERSION);
     wp_register_style('nivo-slider-theme', vc_asset_url('lib/bower/nivoslider/themes/default/default.min.css'), array('nivo-slider-css'), WPB_VC_VERSION);
     wp_register_style('prettyphoto', vc_asset_url('lib/prettyphoto/css/prettyPhoto.min.css'), array(), WPB_VC_VERSION);
     wp_register_style('isotope-css', vc_asset_url('css/lib/isotope.min.css'), array(), WPB_VC_VERSION);
     /* nectar addition */
     //wp_register_style( 'font-awesome', vc_asset_url( 'lib/bower/font-awesome/css/font-awesome.min.css' ), array(), WPB_VC_VERSION );
     /* nectar addition end */
     $front_css_file = vc_asset_url('css/js_composer.min.css');
     $upload_dir = wp_upload_dir();
     $vc_upload_dir = vc_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';
         $front_css_file = vc_str_remove_protocol($front_css_file);
     }
     wp_register_style('js_composer_front', $front_css_file, array(), WPB_VC_VERSION);
     $custom_css_path = $upload_dir['basedir'] . '/' . $vc_upload_dir . '/custom.css';
     if (is_file($upload_dir['basedir'] . '/' . $vc_upload_dir . '/custom.css') && filesize($custom_css_path) > 0) {
         $custom_css_url = $upload_dir['baseurl'] . '/' . $vc_upload_dir . '/custom.css';
         $custom_css_url = vc_str_remove_protocol($custom_css_url);
         wp_register_style('js_composer_custom_css', $custom_css_url, array(), WPB_VC_VERSION);
     }
     add_action('wp_enqueue_scripts', array(&$this, 'enqueueStyle'));
     /**
      * @since 4.4
      */
     do_action('vc_base_register_front_css');
 }