예제 #1
0
	public function jsComposerEditPage() {
		$pt_array = vc_editor_post_types();
		foreach ( $pt_array as $pt ) {
			add_meta_box( 'vc_teaser', __( 'VC: Custom Teaser', "js_composer" ), Array( &$this, 'outputTeaser' ), $pt, 'side' );
		}
		add_action( 'save_post', array( &$this, 'saveTeaserMetaBox' ) );
	}
/**
 * Add WP ui pointers to backend editor.
 */
function vc_add_admin_pointer()
{
    if (is_admin()) {
        foreach (vc_editor_post_types() as $post_type) {
            add_filter('vc_ui-pointers-' . $post_type, 'vc_backend_editor_register_pointer');
        }
    }
}
예제 #3
0
	/**
	 * Enqueue required javascript libraries and css files.
	 *
	 * This method also setups reminder about license activation.
	 *
	 * @since  4.2
	 * @access public
	 */
	public function printScriptsMessages() {
		if ( in_array( get_post_type(), vc_editor_post_types() )) {
			vc_license()->setupReminder();
			wp_enqueue_style( 'wp-color-picker' );
			wp_enqueue_script( 'wp-color-picker' );
			wp_enqueue_style( 'farbtastic' );
			wp_enqueue_style( 'ui-custom-theme' );
			wp_enqueue_style( 'isotope-css' );
			wp_enqueue_style( 'animate-css' );
			wp_enqueue_style( 'js_composer' );
			wp_enqueue_style( 'wpb_jscomposer_autosuggest' );

			WPBakeryShortCode_Settings::enqueueCss();

			wp_enqueue_script( 'jquery-ui-tabs' );
			wp_enqueue_script( 'jquery-ui-sortable' );
			wp_enqueue_script( 'jquery-ui-droppable' );
			wp_enqueue_script( 'jquery-ui-draggable' );
			wp_enqueue_script( 'jquery-ui-accordion' );
			wp_enqueue_script( 'jquery-ui-autocomplete' );

			wp_enqueue_script( 'farbtastic' );

			//MMM wp_enqueue_script('bootstrap-js');
			wp_enqueue_script( 'isotope' );
			wp_enqueue_script( 'wpb_bootstrap_modals_js' );
			wp_enqueue_script( 'wpb_scrollTo_js' );
			wp_enqueue_script( 'wpb_php_js' );
			// js composer js app {{
			// wpb_js_composer_js_sortable
			wp_enqueue_script( 'wpb_js_composer_js_sortable' );
			wp_enqueue_script( 'wpb_json-js' );


			wp_enqueue_script( 'wpb_js_composer_js_tools' );
			wp_enqueue_script( 'wpb_js_composer_js_storage' );
			wp_enqueue_script( 'wpb_js_composer_js_models' );
			wp_enqueue_script( 'wpb_js_composer_js_view' );
			wp_enqueue_script( 'wpb_js_composer_js_custom_views' );

			wp_enqueue_script( 'wpb_js_composer_js_backbone' );
			wp_enqueue_script( 'wpb_jscomposer_composer_js' );
			wp_enqueue_script( 'wpb_jscomposer_shortcode_js' );
			wp_enqueue_script( 'wpb_jscomposer_modal_js' );
			wp_enqueue_script( 'wpb_jscomposer_templates_js' );
			wp_enqueue_script( 'wpb_jscomposer_stage_js' );
			wp_enqueue_script( 'wpb_jscomposer_layout_js' );
			wp_enqueue_script( 'wpb_jscomposer_row_js' );
			wp_enqueue_script( 'wpb_jscomposer_settings_js' );
			wp_enqueue_script( 'wpb_jscomposer_media_editor_js' );
			wp_enqueue_script( 'wpb_jscomposer_autosuggest_js' );
			// }}
			wp_enqueue_script( 'wpb_js_composer_js' );
			WPBakeryShortCode_Settings::enqueueJs();
		}
	}
예제 #4
0
 /**
  * Remove custom teaser meta box.
  *
  * @since 1.1.0
  */
 function presscore_vc_remove_teaser_box()
 {
     global $vc_teaser_box;
     if (is_callable('vc_editor_post_types') && !empty($vc_teaser_box)) {
         $pt_array = vc_editor_post_types();
         foreach ($pt_array as $pt) {
             remove_meta_box('vc_teaser', $pt, 'side');
         }
         remove_action('save_post', array(&$vc_teaser_box, 'saveTeaserMetaBox'));
     }
 }
 function TS_VCSC_Widgets_Post_Compooser()
 {
     if (function_exists('vc_editor_post_types') && function_exists('vc_set_default_editor_post_types') && function_exists('vc_settings')) {
         $TS_VCSC_ComposerContentTypes = vc_editor_post_types();
         $TS_VCSC_ComposerDefaultTypes = array();
         if (!in_array('ts_widgets', $TS_VCSC_ComposerContentTypes, true)) {
             foreach ($TS_VCSC_ComposerContentTypes as $value) {
                 array_push($TS_VCSC_ComposerDefaultTypes, $value);
             }
             array_push($TS_VCSC_ComposerDefaultTypes, 'ts_widgets');
             vc_set_default_editor_post_types($TS_VCSC_ComposerDefaultTypes);
             vc_settings()->set('content_types', $TS_VCSC_ComposerDefaultTypes);
         }
     }
 }
예제 #6
0
파일: wpb.php 프로젝트: SayenkoDesign/ividf
 function om_wpb_head_styles()
 {
     if (in_array(get_post_type(), vc_editor_post_types())) {
         echo '<style>.vc_colored-dropdown .om-theme-color{background-color:' . get_option(OM_THEME_PREFIX . 'hightlight_color') . ';color:#fff !important}</style>';
     }
 }
예제 #7
0
	function showButton( $post_id = null ) {
		global $current_user;
		get_currentuserinfo();
		$show = true;

		if ( ! self::inlineEnabled() || ! current_user_can( 'edit_post', $post_id ) ) return false;
		/** @var $settings - get use group access rules */

		$settings = vc_settings()->get( 'groups_access_rules' );
		foreach ( $current_user->roles as $role ) {
			if ( isset( $settings[$role]['show'] ) && $settings[$role]['show'] === 'no' ) {
				$show = false;
				break;
			}
		}
		return $show && in_array( get_post_type(), vc_editor_post_types() );
	}
 public function isValidPostType()
 {
     return in_array(get_post_type(), vc_editor_post_types() + array('templatera'));
 }
예제 #9
0
 public function compareType($type)
 {
     return in_array($type, array_merge(vc_editor_post_types(), array('templatera')));
 }
예제 #10
0
 /**
  * Add Visual Composer plugin support
  *
  * @link  texthttp://vc.wpbakery.com/
  *
  * @todo  Support for Frontend Editor (VC4+)
  *
  * @since    1.0
  * @version  1.2.3
  *
  * @access  public
  */
 public function visual_composer_support()
 {
     //VC 4+ disabling Frontend Editor
     if (function_exists('vc_disable_frontend')) {
         vc_disable_frontend();
     }
     //VC additional shortcodes admin interface
     $vc_shortcodes_admin_tweaks = apply_filters('wmhook_shortcode_' . 'vc_shortcodes_admin_tweaks_file', $this->page_builder_dir . 'visual-composer/visual-composer.php');
     require_once $vc_shortcodes_admin_tweaks;
     //VC setup screen modifications
     add_filter('vc_settings_tabs', array($this, 'visual_composer_setup'));
     delete_option('wpb_js_use_custom');
     //Disable VC Guide Tour
     if (function_exists('vc_editor_post_types')) {
         foreach (vc_editor_post_types() as $post_type) {
             add_filter('vc_ui-pointers-' . $post_type, '__return_empty_array', 999);
         }
     }
     //VC extending shortcode parameters
     add_shortcode_param('wm_radio', array($this, 'visual_composer_custom_field_wm_radio'));
     //Remove default VC elements (only if current theme supports this)
     if (function_exists('vc_remove_element') && (wma_supports_subfeature('remove_vc_shortcodes') || wma_supports_subfeature('remove-vc-shortcodes')) && class_exists('WPBMap')) {
         $vc_shortcodes_all = array_keys(WPBMap::getShortCodes());
         $vc_shortcodes_keep = array('vc_row', 'vc_row_inner', 'vc_column', 'vc_column_inner', 'vc_raw_html', 'vc_raw_js', 'contact-form-7', 'gravityform', 'layerslider_vc', 'rev_slider_vc');
         // Do not remove custom mapped shortcodes via WP admin
         if (class_exists('Vc_Automap_Model') && is_callable('Vc_Automap_Model::findAll')) {
             $vc_shortcodes_custom = Vc_Automap_Model::findAll();
             foreach ($vc_shortcodes_custom as $shortcode) {
                 $vc_shortcodes_keep[] = $shortcode->tag;
             }
         }
         $vc_shortcodes_keep = apply_filters('wmhook_shortcode_' . 'vc_keep', $vc_shortcodes_keep);
         $vc_shortcodes_remove = apply_filters('wmhook_shortcode_' . 'vc_remove', array_diff($vc_shortcodes_all, $vc_shortcodes_keep));
         //Array check required due to filter applied above
         if (is_array($vc_shortcodes_remove) && !empty($vc_shortcodes_remove)) {
             foreach ($vc_shortcodes_remove as $shortcode) {
                 vc_remove_element($shortcode);
             }
         }
     }
     //Add custom VC elements
     if (function_exists('vc_map') && !empty(self::$codes['vc_plugin'])) {
         ksort(self::$codes['vc_plugin']);
         foreach (self::$codes['vc_plugin'] as $shortcode) {
             //simple validation (as of http://kb.wpbakery.com/index.php?title=Vc_map, the below 2 parameters are required)
             if (!isset($shortcode['name']) || !isset($shortcode['base'])) {
                 continue;
             }
             //sort shortcode parameters array
             if (isset($shortcode['params'])) {
                 ksort($shortcode['params']);
             }
             // Fix required for Visual Composer 4.5.2+
             $shortcode['params'] = array_values($shortcode['params']);
             vc_map($shortcode);
         }
     }
 }
 function __construct()
 {
     $this->assets_js = plugin_dir_path(__FILE__) . 'js/';
     $this->assets_css = plugin_dir_path(__FILE__) . 'css/';
     $this->assets_dir = plugin_dir_path(__FILE__) . 'assets/';
     $this->classes_dir = plugin_dir_path(__FILE__) . 'classes/';
     $this->elements_dir = plugin_dir_path(__FILE__) . 'elements/';
     $this->shortcode_dir = plugin_dir_path(__FILE__) . 'shortcodes/';
     $this->plugins_dir = plugin_dir_path(__FILE__) . 'plugins/';
     $this->woocommerce_dir = plugin_dir_path(__FILE__) . 'woocommerce/';
     $this->bbpress_dir = plugin_dir_path(__FILE__) . 'bbpress/';
     $this->posttypes_dir = plugin_dir_path(__FILE__) . 'posttypes/';
     $this->images_dir = plugin_dir_path(__FILE__) . 'images/';
     $this->icons_dir = plugin_dir_path(__FILE__) . 'icons/';
     $this->detector_dir = plugin_dir_path(__FILE__) . 'detector/';
     $this->parameters_dir = plugin_dir_path(__FILE__) . 'parameters/';
     $this->TS_VCSC_PluginSlug = plugin_basename(__FILE__);
     $this->TS_VCSC_PluginPath = plugin_dir_url(__FILE__);
     $this->TS_VCSC_PluginDir = plugin_dir_path(__FILE__);
     // Check and Store VC Version, Applicable Post Types and Icon Picker
     // -----------------------------------------------------------------
     if (function_exists('vc_editor_post_types')) {
         $this->TS_VCSC_VisualComposer_Posts = vc_editor_post_types();
     }
     if (defined('WPB_VC_VERSION')) {
         $this->TS_VCSC_VisualComposer_Version = WPB_VC_VERSION;
         if (TS_VCSC_VersionCompare(WPB_VC_VERSION, '4.3.0') >= 0) {
             if (get_option('ts_vcsc_extend_settings_backendPreview', 1) == 1) {
                 $this->TS_VCSC_EditorLivePreview = "true";
             } else {
                 $this->TS_VCSC_EditorLivePreview = "false";
             }
         } else {
             $this->TS_VCSC_EditorLivePreview = "false";
         }
         if (TS_VCSC_VersionCompare(WPB_VC_VERSION, '4.4.0') >= 0) {
             $this->TS_VCSC_EditorIconFontsInternal = "true";
             $this->TS_VCSC_VisualComposer_Compliant = "true";
             $this->TS_VCSC_EditorFullWidthInternal = "true";
         } else {
             $this->TS_VCSC_EditorIconFontsInternal = "false";
             $this->TS_VCSC_VisualComposer_Compliant = "false";
             $this->TS_VCSC_EditorFullWidthInternal = "false";
         }
     } else {
         $this->TS_VCSC_EditorLivePreview = "false";
         $this->TS_VCSC_EditorIconFontsInternal = "false";
         $this->TS_VCSC_VisualComposer_Compliant = "false";
         $this->TS_VCSC_EditorFullWidthInternal = "false";
     }
     // Check and Set other Global Variables
     // ------------------------------------
     // Check if All Files should be loaded
     if (get_option('ts_vcsc_extend_settings_loadForcable', 0) == 0) {
         $this->TS_VCSC_LoadFrontEndForcable = "false";
     } else {
         $this->TS_VCSC_LoadFrontEndForcable = "true";
     }
     // Check if Waypoints should be loaded
     if (get_option('ts_vcsc_extend_settings_loadWaypoints', 1) == 1) {
         $this->TS_VCSC_LoadFrontEndWaypoints = "true";
     } else {
         $this->TS_VCSC_LoadFrontEndWaypoints = "false";
     }
     // Check if Modernizr should be loaded
     if (get_option('ts_vcsc_extend_settings_loadModernizr', 1) == 1) {
         $this->TS_VCSC_LoadFrontEndModernizr = "true";
     } else {
         $this->TS_VCSC_LoadFrontEndModernizr = "false";
     }
     // Check if CountTo should be loaded
     if (get_option('ts_vcsc_extend_settings_loadCountTo', 1) == 1) {
         $this->TS_VCSC_LoadFrontEndCountTo = "true";
     } else {
         $this->TS_VCSC_LoadFrontEndCountTo = "false";
     }
     // Check if CountUp should be loaded
     if (get_option('ts_vcsc_extend_settings_loadCountUp', 1) == 1) {
         $this->TS_VCSC_LoadFrontEndCountUp = "true";
     } else {
         $this->TS_VCSC_LoadFrontEndCountUp = "false";
     }
     // Check if Lightbox should be loaded
     if (get_option('ts_vcsc_extend_settings_loadLightbox', 0) == 1) {
         $this->TS_VCSC_LoadFrontEndLightbox = "true";
     } else {
         $this->TS_VCSC_LoadFrontEndLightbox = "false";
     }
     // Check if Tooltips should be loaded
     if (get_option('ts_vcsc_extend_settings_loadTooltip', 0) == 1) {
         $this->TS_VCSC_LoadFrontEndTooltips = "true";
     } else {
         $this->TS_VCSC_LoadFrontEndTooltips = "false";
     }
     // Check if ForceLoad of jQuery
     if (get_option('ts_vcsc_extend_settings_loadjQuery', 0) == 1) {
         $this->TS_VCSC_LoadFrontEndJQuery = "true";
     } else {
         $this->TS_VCSC_LoadFrontEndJQuery = "false";
     }
     // Check for Editor Image Preview
     if (get_option('ts_vcsc_extend_settings_previewImages', 1) == 1) {
         $this->TS_VCSC_EditorImagePreview = "true";
     } else {
         $this->TS_VCSC_EditorImagePreview = "false";
     }
     // Check for Background Indicator
     if (get_option('ts_vcsc_extend_settings_backgroundIndicator', 1) == 1) {
         $this->TS_VCSC_EditorBackgroundIndicator = "true";
     } else {
         $this->TS_VCSC_EditorBackgroundIndicator = "false";
     }
     // Check for Visual Icon Selector
     if (get_option('ts_vcsc_extend_settings_visualSelector', 1) == 1) {
         $this->TS_VCSC_EditorVisualSelector = "true";
     } else {
         $this->TS_VCSC_EditorVisualSelector = "false";
     }
     // Check for Native Icon Selector
     if (get_option('ts_vcsc_extend_settings_nativeSelector', 1) == 1) {
         $this->TS_VCSC_EditorNativeSelector = "true";
     } else {
         $this->TS_VCSC_EditorNativeSelector = "false";
     }
     // Check for Built-In Lightbox
     if (get_option('ts_vcsc_extend_settings_builtinLightbox', 1) == 1) {
         $this->TS_VCSC_UseInternalLightbox = "true";
     } else {
         $this->TS_VCSC_UseInternalLightbox = "false";
     }
     // Load Public Arrays that Define Element Settings
     // -----------------------------------------------
     require_once $this->assets_dir . 'ts_vcsc_arrays_public.php';
     // Load Arrays of Other Selection Items and Variables
     // --------------------------------------------------
     require_once $this->assets_dir . 'ts_vcsc_arrays_other.php';
     $this->TS_VCSC_PluginIsMultiSiteActive = is_plugin_active_for_network('ts-visual-composer-extend/ts-visual-composer-extend.php') == true ? "true" : "false";
     //ksort($this->TS_VCSC_Visual_Composer_Elements);
     // Status of WooCommerce Elements
     // ------------------------------
     if (in_array('woocommerce/woocommerce.php', apply_filters('active_plugins', get_option('active_plugins')))) {
         $this->TS_VCSC_WooCommerceVersion = $this->TS_VCSC_WooCommerceVersion();
         $this->TS_VCSC_WooCommerceActive = "true";
         if (defined('WPB_VC_VERSION')) {
             if (TS_VCSC_VersionCompare(WPB_VC_VERSION, '4.4.0') >= 0) {
                 $this->TS_VCSC_WooCommerceRemove = "true";
             } else {
                 $this->TS_VCSC_WooCommerceRemove = "false";
             }
         } else {
             $this->TS_VCSC_WooCommerceRemove = "false";
         }
     } else {
         $this->TS_VCSC_WooCommerceVersion = "";
         $this->TS_VCSC_WooCommerceActive = "false";
         $this->TS_VCSC_WooCommerceRemove = "false";
     }
     // Status of bbPress Elements
     // --------------------------
     if (in_array('bbpress/bbpress.php', apply_filters('active_plugins', get_option('active_plugins')))) {
         $this->TS_VCSC_bbPressVersion = "";
         $this->TS_VCSC_bbPressActive = "true";
     } else {
         $this->TS_VCSC_bbPressVersion = "";
         $this->TS_VCSC_bbPressActive = "false";
     }
     // Check for Standalone Iconicum Plugin
     // ------------------------------------
     if (in_array('ts-iconicum-icon-fonts/ts-iconicum-icon-fonts.php', apply_filters('active_plugins', get_option('active_plugins'))) || class_exists('ICONICUM_ICON_FONTS')) {
         $this->TS_VCSC_IconicumStandard = "true";
     } else {
         $this->TS_VCSC_IconicumStandard = "false";
     }
     // Load Icon Shortcode Generator
     // -----------------------------
     if ($this->TS_VCSC_PluginIsMultiSiteActive == "true") {
         if (get_option('ts_vcsc_extend_settings_extended', 0) == 1 && get_option('ts_vcsc_extend_settings_iconicum', 1) == 1 && get_option('ts_vcsc_extend_settings_useIconGenerator', 0) == 1 || get_option('ts_vcsc_extend_settings_extended', 0) == 0 && get_option('ts_vcsc_extend_settings_useIconGenerator', 0) == 1 && get_site_option('ts_vcsc_extend_settings_demo', 1) == 0) {
             $this->TS_VCSC_IconicumActivated = "true";
         } else {
             $this->TS_VCSC_IconicumActivated = "false";
         }
     } else {
         if (get_option('ts_vcsc_extend_settings_extended', 0) == 1 && get_option('ts_vcsc_extend_settings_iconicum', 1) == 1 && get_option('ts_vcsc_extend_settings_useIconGenerator', 0) == 1 || get_option('ts_vcsc_extend_settings_extended', 0) == 0 && get_option('ts_vcsc_extend_settings_useIconGenerator', 0) == 1 && get_option('ts_vcsc_extend_settings_demo', 1) == 0) {
             $this->TS_VCSC_IconicumActivated = "true";
         } else {
             $this->TS_VCSC_IconicumActivated = "false";
         }
     }
     if ($this->TS_VCSC_IconicumStandard == "false") {
         if ($this->TS_VCSC_IconicumActivated == "true") {
             require_once $this->assets_dir . 'ts_vcsc_editor_button.php';
         }
     }
     // Load and Initialize the Auto-Update Class
     // -----------------------------------------
     if ($this->TS_VCSC_PluginIsMultiSiteActive == "true") {
         if (get_site_option('ts_vcsc_extend_settings_demo', 1) == 0 && get_option('ts_vcsc_extend_settings_extended', 0) == 0 && strpos(get_site_option('ts_vcsc_extend_settings_licenseInfo', ''), get_site_option('ts_vcsc_extend_settings_licenseKeyed', 'emptydelimiterfix')) != FALSE) {
             add_action('admin_init', array($this, 'TS_VCSC_ActivateAutoUpdate'));
         }
     } else {
         if (get_option('ts_vcsc_extend_settings_demo', 1) == 0 && get_option('ts_vcsc_extend_settings_extended', 0) == 0 && strpos(get_option('ts_vcsc_extend_settings_licenseInfo', ''), get_option('ts_vcsc_extend_settings_licenseKeyed', 'emptydelimiterfix')) != FALSE) {
             add_action('admin_init', array($this, 'TS_VCSC_ActivateAutoUpdate'));
         }
     }
     // Load Arrays of Font Settings
     // ----------------------------
     add_action('init', array($this, 'TS_VCSC_IconFontArrays'), 1);
     // Load Language / Translation Files
     // ---------------------------------
     if (get_option('ts_vcsc_extend_settings_translationsDomain', 1) == 1) {
         add_action('init', array($this, 'TS_VCSC_LoadTextDomains'), 9);
     }
     $plugin = plugin_basename(__FILE__);
     add_filter("plugin_action_links_{$plugin}", array($this, "TS_VCSC_PluginAddSettingsLink"));
     if ($this->TS_VCSC_PluginIsMultiSiteActive == "true") {
         if (get_site_option('ts_vcsc_extend_settings_licenseValid', 0) == 1 && strpos(get_site_option('ts_vcsc_extend_settings_licenseInfo', ''), get_site_option('ts_vcsc_extend_settings_licenseKeyed', 'emptydelimiterfix')) != FALSE || get_option('ts_vcsc_extend_settings_extended', 0) == 1) {
             update_site_option('ts_vcsc_extend_settings_demo', 0);
         } else {
             update_site_option('ts_vcsc_extend_settings_demo', 1);
         }
     } else {
         if (get_option('ts_vcsc_extend_settings_licenseValid', 0) == 1 && strpos(get_option('ts_vcsc_extend_settings_licenseInfo', ''), get_option('ts_vcsc_extend_settings_licenseKeyed', 'emptydelimiterfix')) != FALSE || get_option('ts_vcsc_extend_settings_extended', 0) == 1) {
             update_option('ts_vcsc_extend_settings_demo', 0);
         } else {
             update_option('ts_vcsc_extend_settings_demo', 1);
         }
     }
     // Register Custom CSS and JS Inputs
     // ---------------------------------
     if (get_option('ts_vcsc_extend_settings_codeeditors', 1) == 1) {
         add_action('admin_init', array($this, 'TS_VCSC_RegisterCustomCSS_Setting'));
         add_action('admin_init', array($this, 'TS_VCSC_RegisterCustomJS_Setting'));
     }
     // Function to Register / Load External Files on Back-End
     // ------------------------------------------------------
     add_action('admin_enqueue_scripts', array($this, 'TS_VCSC_Extensions_Admin_Files'), 999999999);
     add_action('admin_head', array($this, 'TS_VCSC_Extensions_Admin_Variables'), 999999999);
     // Function to Register / Load External Files on Front-End
     // -------------------------------------------------------
     add_action('wp_enqueue_scripts', array($this, 'TS_VCSC_Extensions_Front_Main'), 999999999);
     add_action('wp_head', array($this, 'TS_VCSC_Extensions_Front_Variables'), 1);
     add_action('wp_head', array($this, 'TS_VCSC_Extensions_Front_Head'), 8888);
     add_action('wp_footer', array($this, 'TS_VCSC_Extensions_Front_Footer'), 8888);
     // Add Dashboard Widget
     // --------------------
     if (get_option('ts_vcsc_extend_settings_dashboard', 1) == 1) {
         add_action('wp_dashboard_setup', array($this, 'TS_VCSC_DashboardHelpWidget'));
     }
     // Create Custom Post Types
     // ------------------------
     if (get_option('ts_vcsc_extend_settings_extended', 0) == 1 && get_option('ts_vcsc_extend_settings_posttypes', 1) == 1) {
         if (get_option('ts_vcsc_extend_settings_posttypeTeam', 1) == 0 && get_option('ts_vcsc_extend_settings_posttypeTestimonial', 1) == 0 && get_option('ts_vcsc_extend_settings_posttypeLogo', 1) == 0 && get_option('ts_vcsc_extend_settings_posttypeSkillset', 1) == 0 && get_option('ts_vcsc_extend_settings_posttypeTimeline', 1) == 0) {
             update_option('ts_vcsc_extend_settings_posttypes', 0);
         }
     }
     if (get_option('ts_vcsc_extend_settings_extended', 0) == 1 && get_option('ts_vcsc_extend_settings_posttypes', 1) == 1 || get_option('ts_vcsc_extend_settings_extended', 0) == 0) {
         $this->TS_VCSC_CustomPostTypesCheckup = "true";
         if (get_option('ts_vcsc_extend_settings_extended', 0) == 0 && get_option('ts_vcsc_extend_settings_customTeam', 0) == 1 || get_option('ts_vcsc_extend_settings_extended', 0) == 1 && get_option('ts_vcsc_extend_settings_posttypeTeam', 1) == 1 && get_option('ts_vcsc_extend_settings_customTeam', 0) == 1 && get_option('ts_vcsc_extend_settings_posttypes', 1) == 1) {
             $this->TS_VCSC_CustomPostTypesTeam = "true";
         } else {
             $this->TS_VCSC_CustomPostTypesTeam = "false";
         }
         if (get_option('ts_vcsc_extend_settings_extended', 0) == 0 && get_option('ts_vcsc_extend_settings_customTestimonial', 0) == 1 || get_option('ts_vcsc_extend_settings_extended', 0) == 1 && get_option('ts_vcsc_extend_settings_posttypeTestimonial', 1) == 1 && get_option('ts_vcsc_extend_settings_customTestimonial', 0) == 1 && get_option('ts_vcsc_extend_settings_posttypes', 1) == 1) {
             $this->TS_VCSC_CustomPostTypesTestimonial = "true";
         } else {
             $this->TS_VCSC_CustomPostTypesTestimonial = "false";
         }
         if (get_option('ts_vcsc_extend_settings_extended', 0) == 0 && get_option('ts_vcsc_extend_settings_customLogo', 0) == 1 || get_option('ts_vcsc_extend_settings_extended', 0) == 1 && get_option('ts_vcsc_extend_settings_posttypeLogo', 1) == 1 && get_option('ts_vcsc_extend_settings_customLogo', 0) == 1 && get_option('ts_vcsc_extend_settings_posttypes', 1) == 1) {
             $this->TS_VCSC_CustomPostTypesLogo = "true";
         } else {
             $this->TS_VCSC_CustomPostTypesLogo = "false";
         }
         if (get_option('ts_vcsc_extend_settings_extended', 0) == 0 && get_option('ts_vcsc_extend_settings_customSkillset', 0) == 1 || get_option('ts_vcsc_extend_settings_extended', 0) == 1 && get_option('ts_vcsc_extend_settings_posttypeSkillset', 1) == 1 && get_option('ts_vcsc_extend_settings_customSkillset', 0) == 1 && get_option('ts_vcsc_extend_settings_posttypes', 1) == 1) {
             $this->TS_VCSC_CustomPostTypesSkillset = "true";
         } else {
             $this->TS_VCSC_CustomPostTypesSkillset = "false";
         }
         if (get_option('ts_vcsc_extend_settings_extended', 0) == 0 && get_option('ts_vcsc_extend_settings_customTimelines', 0) == 1 || get_option('ts_vcsc_extend_settings_extended', 0) == 1 && get_option('ts_vcsc_extend_settings_posttypeTimeline', 1) == 1 && get_option('ts_vcsc_extend_settings_customTimelines', 0) == 1 && get_option('ts_vcsc_extend_settings_posttypes', 1) == 1) {
             $this->TS_VCSC_CustomPostTypesTimeline = "true";
         } else {
             $this->TS_VCSC_CustomPostTypesTimeline = "false";
         }
     } else {
         $this->TS_VCSC_CustomPostTypesCheckup = "false";
         $this->TS_VCSC_CustomPostTypesTeam = "false";
         $this->TS_VCSC_CustomPostTypesTestimonial = "false";
         $this->TS_VCSC_CustomPostTypesLogo = "false";
         $this->TS_VCSC_CustomPostTypesSkillset = "false";
         $this->TS_VCSC_CustomPostTypesTimeline = "false";
     }
     if ($this->TS_VCSC_CustomPostTypesTeam == "true" || $this->TS_VCSC_CustomPostTypesTestimonial == "true" || $this->TS_VCSC_CustomPostTypesLogo == "true" || $this->TS_VCSC_CustomPostTypesSkillset == "true" || $this->TS_VCSC_CustomPostTypesTimeline == "true") {
         require_once $this->posttypes_dir . 'ts_vcsc_custom_post_registration.php';
         $this->TS_VCSC_CustomPostTypesLoaded = "true";
         add_action('init', 'TS_VCSC_CMBMetaBoxes', 7777777777);
         if ($this->TS_VCSC_CustomPostTypesTeam == "true") {
             require_once $this->posttypes_dir . 'ts_vcsc_custom_post_team.php';
             add_action('admin_menu', array($this, 'TS_VCSC_Remove_MetaBoxes_Teams'));
         }
         if ($this->TS_VCSC_CustomPostTypesTestimonial == "true") {
             require_once $this->posttypes_dir . 'ts_vcsc_custom_post_testimonials.php';
             add_action('admin_menu', array($this, 'TS_VCSC_Remove_MetaBoxes_Testimonials'));
         }
         if ($this->TS_VCSC_CustomPostTypesSkillset == "true") {
             require_once $this->posttypes_dir . 'ts_vcsc_custom_post_skillsets.php';
             add_action('admin_menu', array($this, 'TS_VCSC_Remove_MetaBoxes_Skillsets'));
         }
         if ($this->TS_VCSC_CustomPostTypesTimeline == "true") {
             require_once $this->posttypes_dir . 'ts_vcsc_custom_post_timeline.php';
             add_action('admin_menu', array($this, 'TS_VCSC_Remove_MetaBoxes_Timeline'));
         }
         if ($this->TS_VCSC_CustomPostTypesLogo == "true") {
             require_once $this->posttypes_dir . 'ts_vcsc_custom_post_logos.php';
             add_action('admin_menu', array($this, 'TS_VCSC_Remove_MetaBoxes_Logos'));
         }
     }
     // Create Custom Admin Menu for Plugin
     // -----------------------------------
     require_once $this->assets_dir . 'ts_vcsc_registrations_menu.php';
     // Load Shortcode Definitions
     // --------------------------
     add_action('init', array($this, 'TS_VCSC_RegisterAllShortcodes'), 888888888);
     //add_action('vc_before_init', 				array($this, 	'TS_VCSC_RegisterAllShortcodes'), 			888888888);
     // Load Composer Elements
     // ----------------------
     add_action('init', array($this, 'TS_VCSC_RegisterWithComposer'), 999999999);
     //add_action('after_setup_theme',			array($this,	'TS_VCSC_RegisterWithComposer'));
     //add_action('vc_before_init',				array($this, 	'TS_VCSC_RegisterWithComposer'), 			999999999);
     add_action('admin_init', array($this, 'TS_VCSC_ChangeDownloadsUploadDirectory'), 999);
     add_action('admin_notices', array($this, 'TS_VCSC_CustomPackInstalledError'));
     add_action('wp_ajax_ts_delete_custom_pack', array($this, 'TS_VCSC_DeleteCustomPack_Ajax'));
     add_action('wp_ajax_ts_savepostmetadata', array($this, 'TS_VCSC_SavePostMetaData'));
     add_action('wp_ajax_ts_system_download', array($this, 'TS_VCSC_DownloadSystemInfoData'));
     add_action('wp_ajax_ts_export_settings', array($this, 'TS_VCSC_ExportPluginSettings'));
     // Allow Shortcodes in Widgets / Sidebar
     // -------------------------------------
     add_filter('widget_text', 'do_shortcode');
     // Check Default Settings Arrays
     // -----------------------------
     if (get_option('ts_vcsc_extend_settings_dataRestore', 0) == 1) {
         add_action('admin_init', array($this, 'TS_VCSC_CheckDefaultOptions'), 888888888);
     }
     // Enable / Disable VC Frontend Editor
     // -----------------------------------
     if (function_exists('vc_enabled_frontend') && function_exists('vc_disable_frontend')) {
         if (get_option('ts_vcsc_extend_settings_frontendEditor', 1) == 0) {
             vc_disable_frontend(true);
         } else {
             if (get_option('ts_vcsc_extend_settings_frontendEditor', 1) == 1) {
                 vc_disable_frontend(false);
             }
         }
     }
     // Redirect to "About Composium" Page After Activation
     // ---------------------------------------------------
     add_action('admin_init', array($this, 'TS_VCSC_ActivationRedirect'), 1);
     // Lightbox Media Integrations
     // ---------------------------
     if (get_option('ts_vcsc_extend_settings_lightboxIntegration', 0) == 1) {
         add_filter('image_send_to_editor', array($this, 'TS_VCSC_AddLightboxClassMediaEditor'), 10, 3);
     }
 }
예제 #12
0
 /**
  * Enqueue required javascript libraries and css files.
  *
  * This method also setups reminder about license activation.
  *
  * @since  4.2
  * @access public
  */
 public function printScriptsMessages()
 {
     if (in_array(get_post_type(), vc_editor_post_types())) {
         vc_license()->setupReminder();
         wp_enqueue_style('wp-color-picker');
         wp_enqueue_script('wp-color-picker');
         wp_enqueue_style('farbtastic');
         wp_enqueue_style('ui-custom-theme');
         wp_enqueue_style('isotope-css');
         wp_enqueue_style('animate-css');
         wp_enqueue_style('js_composer');
         wp_enqueue_style('wpb_jscomposer_autosuggest');
         WPBakeryShortCode_Settings::enqueueCss();
         wp_enqueue_script('jquery-ui-tabs');
         wp_enqueue_script('jquery-ui-sortable');
         wp_enqueue_script('jquery-ui-droppable');
         wp_enqueue_script('jquery-ui-draggable');
         wp_enqueue_script('jquery-ui-accordion');
         wp_enqueue_script('jquery-ui-autocomplete');
         wp_enqueue_script('farbtastic');
         wp_enqueue_script('isotope');
         wp_enqueue_script('vc_bootstrap_js', vc_asset_url('lib/bootstrap3/dist/js/bootstrap.min.js'), array('jquery'), '3.0.2', true);
         wp_enqueue_script('wpb_scrollTo_js');
         wp_enqueue_script('wpb_php_js');
         wp_enqueue_script('wpb_js_composer_js_sortable');
         wp_enqueue_script('wpb_json-js');
         wp_enqueue_style('js_composer_settings', vc_asset_url('css/js_composer_settings.css'), false, WPB_VC_VERSION, false);
         wp_enqueue_script('ace-editor');
         wp_enqueue_script('webfont', '//ajax.googleapis.com/ajax/libs/webfont/1.4.7/webfont.js');
         // Google Web Font CDN
         wp_enqueue_script('wpb_js_composer_js_tools');
         wp_enqueue_script('wpb_js_composer_js_storage');
         wp_enqueue_script('wpb_js_composer_js_models');
         wp_enqueue_script('wpb_js_composer_js_view');
         wp_enqueue_script('wpb_js_composer_js_custom_views');
         /**
          * Enqueue deprecated
          */
         wp_enqueue_script('vc_js_composer_js_backend_deprecated', vc_asset_url('js/backend/deprecated.js'), array('wpb_js_composer_js_view'), WPB_VC_VERSION, true);
         wp_enqueue_script('wpb_js_composer_js_backbone');
         wp_enqueue_script('wpb_jscomposer_composer_js');
         wp_enqueue_script('wpb_jscomposer_shortcode_js');
         wp_enqueue_script('wpb_jscomposer_modal_js');
         wp_enqueue_script('wpb_jscomposer_templates_js');
         wp_enqueue_script('wpb_jscomposer_stage_js');
         wp_enqueue_script('wpb_jscomposer_layout_js');
         wp_enqueue_script('wpb_jscomposer_row_js');
         wp_enqueue_script('wpb_jscomposer_settings_js');
         wp_enqueue_script('wpb_jscomposer_media_editor_js');
         wp_enqueue_script('wpb_jscomposer_autosuggest_js');
         // }}
         wp_enqueue_script('wpb_js_composer_js');
         WPBakeryShortCode_Settings::enqueueJs();
     }
 }
<?php

/**
 * Add WP ui pointers to backend editor.
 */
if (is_admin()) {
    foreach (vc_editor_post_types() as $post_type) {
        add_filter('vc_ui-pointers-' . $post_type, 'vc_backend_editor_register_pointer');
    }
}
function vc_backend_editor_register_pointer($p)
{
    $screen = get_current_screen();
    if ('add' === $screen->action) {
        $p['vc_pointers_backend_editor'] = array('name' => 'vcPointerController', 'messages' => array(array('target' => '.composer-switch', 'options' => array('content' => sprintf('<h3> %s </h3> <p> %s </p>', __('Welcome to Visual Composer', 'js_composer'), __('Choose Backend or Frontend editor.', 'js_composer')), 'position' => array('edge' => 'left', 'align' => 'center'), 'buttonsEvent' => 'vcPointersEditorsTourEvents')), array('target' => '#vc_templates-editor-button, #vc-templatera-editor-button', 'options' => array('content' => sprintf('<h3> %s </h3> <p> %s </p>', __('Add Elements', 'js_composer'), __('Add new element or start with a template.', 'js_composer')), 'position' => array('edge' => 'left', 'align' => 'center'), 'buttonsEvent' => 'vcPointersEditorsTourEvents'), 'closeEvent' => 'shortcodes:vc_row:add', 'showEvent' => 'backendEditor.show'), array('target' => '[data-vc-control="add"]:first', 'options' => array('content' => sprintf('<h3> %s </h3> <p> %s </p>', __('Rows and Columns', 'js_composer'), __('This is a row container. Divide it into columns and style it. You can add elements into columns.', 'js_composer')), 'position' => array('edge' => 'left', 'align' => 'center'), 'buttonsEvent' => 'vcPointersEditorsTourEvents'), 'closeEvent' => 'click #wpb_visual_composer', 'showEvent' => 'shortcodeView:ready'), array('target' => '.wpb_column_container:first .wpb_content_element:first .vc_controls-cc', 'options' => array('content' => sprintf('<h3> %s </h3> <p> %s <br/><br/> %s</p>', __('Control Elements', 'js_composer'), __('You can edit your element at any time and drag it around your layout.', 'js_composer'), sprintf(__('P.S. Learn more at our <a href="%s" target="_blank">Knowledge Base</a>.', 'js_composer'), 'http://kb.wpbakery.com')), 'position' => array('edge' => 'left', 'align' => 'center'), 'buttonsEvent' => 'vcPointersEditorsTourEvents'), 'showCallback' => 'vcPointersShowOnContentElementControls', 'closeEvent' => 'click #wpb_visual_composer')));
        /*
        $p[ 'showEvent_pointers_backend_editor' ] = array(
        	'name' => 'vcEventPointerController',
        	'type' => 'map_on_event',
        	'messages' => array(
        		array(
        			'target'  => '.vc_control.column_add.vc_column-add:first',
        			'options' => array(
        				'content'  => sprintf( '<h3> %s </h3> <p> %s </p>',
        					__( 'Ha ha this is third', 'js_composer' ),
        					__( '3 Ps use predefined template as a starting point and modify it.', 'js_composer' )
        				),
        				'position' => array( 'edge' => 'left', 'align' => 'center' ),
        				'buttons' => 'vcPointersEditorsTourEvents',
        				'closeEvent' => 'click #poststuff',
        				'showEvent' => 'shortcodes:vc_column',