当前位置: 首页>>代码示例>>PHP>>正文


PHP vc_settings函数代码示例

本文整理汇总了PHP中vc_settings函数的典型用法代码示例。如果您正苦于以下问题:PHP vc_settings函数的具体用法?PHP vc_settings怎么用?PHP vc_settings使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了vc_settings函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: vc_page_settings_tab_color_submit_attributes

function vc_page_settings_tab_color_submit_attributes($submitButtonAttributes)
{
    $submitButtonAttributes['data-vc-less-path'] = vc_asset_url('less/js_composer.less');
    $submitButtonAttributes['data-vc-less-root'] = 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;
}
开发者ID:arkev,项目名称:IntelligentMode,代码行数:7,代码来源:page-design-options.php

示例2: activate

 /**
  *
  */
 public function activate()
 {
     $params = array();
     $params['username'] = vc_post_param('username');
     $params['version'] = WPB_VC_VERSION;
     $params['key'] = vc_post_param('key');
     $params['api_key'] = vc_post_param('api_key');
     $params['url'] = get_site_url();
     $params['ip'] = isset($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : '';
     $params['dkey'] = substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 20);
     $string = 'activatelicense?';
     $request_url = self::getWpbControlUrl(array($string, http_build_query($params, '', '&')));
     $response = wp_remote_get($request_url, array('timeout' => 300));
     if (is_wp_error($response)) {
         echo json_encode(array('result' => false));
         die;
     }
     $result = json_decode($response['body']);
     if (!is_object($result)) {
         echo json_encode(array('result' => false));
         die;
     }
     if ((bool) $result->result === true || (int) $result->code === 401 && isset($result->deactivation_key)) {
         $this->setDeactivation(isset($result->code) && (int) $result->code === 401 ? $result->deactivation_key : $params['dkey']);
         vc_settings()->set('envato_username', $params['username']);
         vc_settings()->set('envato_api_key', $params['api_key']);
         vc_settings()->set('js_composer_purchase_code', $params['key']);
         echo json_encode(array('result' => true));
         die;
     }
     echo $response['body'];
     die;
 }
开发者ID:SayenkoDesign,项目名称:ividf,代码行数:36,代码来源:class-vc-license.php

示例3: vc_column_offset_class_merge

function vc_column_offset_class_merge($column_offset, $width)
{
    // Remove offset settings if
    if (vc_settings()->get('not_responsive_css') === '1') {
        $column_offset = preg_replace('/vc_col\\-(lg|md|xs)[^\\s]*/', '', $column_offset);
    }
    if (preg_match('/vc_col\\-sm\\-\\d+/', $column_offset)) {
        return $column_offset;
    }
    return $width . (empty($column_offset) ? '' : ' ' . $column_offset);
}
开发者ID:szpaddy,项目名称:the7,代码行数:11,代码来源:column_offset.php

示例4: bodyClass

 /**
  * Method adds css class to body tag.
  *
  * Hooked class method by body_class WP filter. Method adds custom css class to body tag of the page to help
  * identify and build design specially for VC shortcodes.
  *
  * @since  4.2
  * @access public
  * @param $classes
  * @return array
  */
 public function bodyClass($classes)
 {
     $classes[] = 'wpb-js-composer js-comp-ver-' . WPB_VC_VERSION;
     $disable_responsive = vc_settings()->get('not_responsive_css');
     if ($disable_responsive !== '1') {
         $classes[] = 'vc_responsive';
     } else {
         $classes[] = 'vc_non_responsive';
     }
     return $classes;
 }
开发者ID:phupx,项目名称:genco,代码行数:22,代码来源:class-vc-interactions.php

示例5: getControlScreenSize

 public function getControlScreenSize()
 {
     $disable_responsive = vc_settings()->get('not_responsive_css');
     if ($disable_responsive !== '1') {
         $screen_sizes = array(array('title' => __('Desktop', LANGUAGE_ZONE), 'size' => '100%', 'key' => 'default', 'active' => true), array('title' => __('Tablet landscape mode', LANGUAGE_ZONE), 'size' => '1024px', 'key' => 'landscape-tablets'), array('title' => __('Tablet portrait mode', LANGUAGE_ZONE), 'size' => '768px', 'key' => 'portrait-tablets'), array('title' => __('Smartphone landscape mode', LANGUAGE_ZONE), 'size' => '480px', 'key' => 'landscape-smartphones'), array('title' => __('Smartphone portrait mode', LANGUAGE_ZONE), 'size' => '320px', 'key' => 'portrait-smartphones'));
         $output = '<li class="vc_pull-right">' . '<div class="vc_dropdown" id="vc_screen-size-control">' . '<a href="#" class="vc_dropdown-toggle"' . ' title="' . __("Responsive preview", LANGUAGE_ZONE) . '"><i class="vc_icon default"' . ' id="vc_screen-size-current"></i><b class="vc_caret"></b></a>' . '<ul class="vc_dropdown-list">';
         while ($screen = current($screen_sizes)) {
             $output .= '<li><a href="#" title="' . esc_attr($screen['title']) . '"' . ' class="vc_screen-width ' . $screen['key'] . (isset($screen['active']) && $screen['active'] ? ' active' : '') . '" data-size="' . $screen['size'] . '"></a></li>';
             next($screen_sizes);
         }
         $output .= '</ul></div></li>';
         return $output;
     }
     return '';
 }
开发者ID:proj-2014,项目名称:vlan247-test-wp,代码行数:15,代码来源:class-vc-navbar-frontend.php

示例6: TS_VCSC_Widgets_Post_Compooser

 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);
         }
     }
 }
开发者ID:Telemedellin,项目名称:fonvalmed,代码行数:15,代码来源:ts_vcsc_custom_post_registration.php

示例7: Ep_After_Setup

 function Ep_After_Setup()
 {
     if (class_exists('WPBakeryVisualComposerAbstract')) {
         //Enable Visual composer in portfolio
         $pt_array = vc_settings()->get('content_types');
         if (is_array($pt_array)) {
             if (!in_array("portfolio", $pt_array)) {
                 $pt_array[] = "portfolio";
             }
             if (!in_array("page", $pt_array)) {
                 $pt_array[] = "page";
             }
             vc_settings()->set('content_types', $pt_array);
         }
     }
     //Initialize default options
     //delete_option(OPTIONS_KEY);
     $options = get_option(OPTIONS_KEY);
     $defaults = ep_admin_get_defaults();
     // Are our options saved in the DB?
     if (false !== $options) {
         $changed = false;
         //Add new keys if any
         foreach ($defaults as $key => $value) {
             if (!array_key_exists($key, $options)) {
                 //Add default value
                 $options[$key] = $value;
                 $changed = true;
             }
         }
         //Check if any key removed from defaults
         foreach ($options as $key => $value) {
             if (!array_key_exists($key, $defaults)) {
                 //Remove the option
                 unset($options[$key]);
                 $changed = true;
             }
         }
         if ($changed) {
             update_option(OPTIONS_KEY, $options);
         }
         return;
     }
     // If not, we'll save our default options
     add_option(OPTIONS_KEY, $defaults);
 }
开发者ID:rmilano24,项目名称:moto,代码行数:46,代码来源:admin-base.php

示例8: getSettings

 /**
  * Gets user role and access rules for current user.
  *
  * @static
  * @return mixed
  */
 protected static function getSettings()
 {
     global $current_user;
     if (self::$settings === null) {
         if (function_exists('get_currentuserinfo')) {
             get_currentuserinfo();
             /** @var $settings - get use group access rules */
             if (!empty($current_user->roles)) {
                 self::$user_role = $current_user->roles[0];
             } else {
                 self::$user_role = 'author';
             }
         } else {
             self::$user_role = 'author';
         }
         self::$settings = vc_settings()->get('groups_access_rules');
     }
     return self::$settings;
 }
开发者ID:ksan5835,项目名称:rankproperties,代码行数:25,代码来源:class-wpb-map.php

示例9: upgradeFilterFromEnvato

 /**
  * Downloads new VC from Envato marketplace and unzips into temporary directory.
  *
  * @param $reply
  * @param $package
  * @param $updater
  * @return mixed|string|WP_Error
  */
 public function upgradeFilterFromEnvato($reply, $package, $updater)
 {
     global $wp_filesystem;
     if (isset($updater->skin->plugin) && $updater->skin->plugin === vc_plugin_name() || isset($updater->skin->plugin_info) && $updater->skin->plugin_info['Name'] === $this->title) {
         $updater->strings['download_envato'] = __('Downloading package from envato market...', LANGUAGE_ZONE);
         $updater->skin->feedback('download_envato');
         $package_filename = 'js_composer.zip';
         $res = $updater->fs_connect(array(WP_CONTENT_DIR));
         if (!$res) {
             return new WP_Error('no_credentials', __("Error! Can't connect to filesystem", LANGUAGE_ZONE));
         }
         $username = vc_settings()->get('envato_username');
         $api_key = vc_settings()->get('envato_api_key');
         $purchase_code = vc_settings()->get('js_composer_purchase_code');
         if (empty($username) || empty($api_key) || empty($purchase_code)) {
             return new WP_Error('no_credentials', __('Error! Envato username, api key and your purchase code are required for downloading updates from Envato marketplace for the Visual Composer. Visit <a href="' . admin_url('options-general.php?page=vc_settings&tab=updater') . '' . '" target="_blank">Settings</a> to fix.', LANGUAGE_ZONE));
         }
         $json = wp_remote_get($this->envatoDownloadPurchaseUrl($username, $api_key, $purchase_code));
         $result = json_decode($json['body'], true);
         if (!isset($result['download-purchase']['download_url'])) {
             return new WP_Error('no_credentials', __('Error! Envato API error' . (isset($result['error']) ? ': ' . $result['error'] : '.'), LANGUAGE_ZONE));
         }
         $result['download-purchase']['download_url'];
         $download_file = download_url($result['download-purchase']['download_url']);
         if (is_wp_error($download_file)) {
             return $download_file;
         }
         $upgrade_folder = $wp_filesystem->wp_content_dir() . 'uploads/js_composer_envato_package';
         if (is_dir($upgrade_folder)) {
             $wp_filesystem->delete($upgrade_folder);
         }
         $result = unzip_file($download_file, $upgrade_folder);
         if ($result && is_file($upgrade_folder . '/' . $package_filename)) {
             return $upgrade_folder . '/' . $package_filename;
         }
         return new WP_Error('no_credentials', __('Error on unzipping package', LANGUAGE_ZONE));
     }
     return $reply;
 }
开发者ID:scottnkerr,项目名称:eeco,代码行数:47,代码来源:class-vc-updater.php

示例10: init

 /**
  * Functions that run on init
  *
  * @since 2.0.0
  */
 public function init()
 {
     // Override editor logo
     add_filter('vc_nav_front_logo', array($this, 'nav_logo'));
     // Remove templatera notice
     remove_action('admin_notices', 'templatera_notice');
     // Set defaults for admin
     if (function_exists('vc_set_default_editor_post_types')) {
         vc_set_default_editor_post_types(array('page', 'portfolio', 'staff', 'templatera'));
     }
     // Set defaults for editor
     if (function_exists('vc_editor_set_post_types ')) {
         $types = vc_settings()->get('content_types');
         if (empty($types)) {
             vc_editor_set_post_types(array('page', 'portfolio', 'staff'));
         }
     }
     // Array of elements to remove
     $elements = array('vc_teaser_grid', 'vc_posts_grid', 'vc_posts_slider', 'vc_carousel', 'vc_gallery', 'vc_wp_text', 'vc_wp_pages', 'vc_wp_links', 'vc_wp_categories', 'vc_wp_meta', 'vc_images_carousel');
     // Add filter for child theme tweaking
     $elements = apply_filters('wpex_vc_remove_elements', $elements);
     // Loop through elements to remove and remove them
     if (is_array($elements)) {
         foreach ($elements as $element) {
             vc_remove_element($element);
         }
     }
     // Add param to tabs
     vc_add_param('vc_tabs', array('type' => 'dropdown', 'heading' => esc_html__('Style', 'total'), 'param_name' => 'style', 'value' => array(esc_html__('Default', 'total') => 'default', esc_html__('Alternative #1', 'total') => 'alternative-one', esc_html__('Alternative #2', 'total') => 'alternative-two')));
     // Add param Tours
     vc_add_param('vc_tour', array('type' => 'dropdown', 'heading' => esc_html__('Style', 'total'), 'param_name' => 'style', 'value' => array(esc_html__('Default', 'total') => 'default', esc_html__('Alternative #1', 'total') => 'alternative-one', esc_html__('Alternative #2', 'total') => 'alternative-two')));
     // Include custom modules
     if (function_exists('vc_lean_map') && wpex_get_mod('extend_visual_composer', true)) {
         $this->total_custom_vc_shortcodes();
     }
 }
开发者ID:iq007,项目名称:MadScape,代码行数:41,代码来源:vc-config.php

示例11: addUpgradeMessageLink

 /**
  * Shows message on Wp plugins page with a link for updating from envato.
  */
 public function addUpgradeMessageLink()
 {
     $username = vc_settings()->get('envato_username');
     $api_key = vc_settings()->get('envato_api_key');
     $purchase_code = vc_settings()->get('js_composer_purchase_code');
     echo '<style type="text/css" media="all">tr#wpbakery-visual-composer + tr.plugin-update-tr a.thickbox + em { display: none; }</style>';
     if (empty($username) || empty($api_key) || empty($purchase_code)) {
         echo ' <a href="' . $this->url . '">' . __('Download new version from CodeCanyon.', 'js_composer') . '</a>';
     } else {
         // update.php?action=upgrade-plugin&plugin=testimonials-widget%2Ftestimonials-widget.php&_wpnonce=6178d48b6e
         // echo '<a href="' . wp_nonce_url( admin_url( 'plugins.php?vc_action=vc_upgrade' ) ) . '">' . __( 'Update Visual Composer now.', 'js_composer' ) . '</a>';
         echo '<a href="' . wp_nonce_url(admin_url('update.php?action=upgrade-plugin&plugin=' . vc_plugin_name()), 'upgrade-plugin_' . vc_plugin_name()) . '">' . __('Update Visual Composer now.', 'js_composer') . '</a>';
     }
 }
开发者ID:SayenkoDesign,项目名称:ividf,代码行数:17,代码来源:class-vc-updating-manager.php

示例12: get_custom_column_class

function get_custom_column_class( $class ) {
	$custom_array = (array)vc_settings()->get( 'column_css_classes' );
	return ! empty( $custom_array[$class] ) ? $custom_array[$class] : '';
}
开发者ID:verbazend,项目名称:AWFA,代码行数:4,代码来源:helpers.php

示例13: showButton

	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() );
	}
开发者ID:verbazend,项目名称:AWFA,代码行数:17,代码来源:class-vc-frontend-editor.php

示例14: get_row_css_class

/**
 * @deprecated 4.2
 * @since 4.2
 * @return mixed|string|void
 */
function get_row_css_class()
{
    // _deprecated_function( 'get_row_css_class', '4.2 (will be removed in 4.10)' );
    $custom = vc_settings()->get('row_css_class');
    return !empty($custom) ? $custom : 'vc_row-fluid';
}
开发者ID:JPodz,项目名称:harlequinnejuice,代码行数:11,代码来源:helpers.php

示例15: settingsFieldThemes

 /**
  * Build theme dropdown
  * @deprecated not used anymore and will be removed
  */
 public function settingsFieldThemes()
 {
     $this->getThemes();
     $field_prefix = vc_settings()->getFieldPrefix();
     $value = ($value = get_option($field_prefix . 'themes')) ? $value : '';
     echo '<select name="' . $field_prefix . 'themes' . '">';
     echo '<option value=""></option>';
     foreach ($this->themes as $key => $title) {
         echo '<option value="' . $key . '"' . ($value === $key ? ' selected="true"' : '') . '>' . __($title, "templatera") . '</option>';
     }
     echo '</select>';
     echo '<p class="description indicator-hint">' . __('Select CSS Theme to change content elements visual appearance.', "templatera") . '</p>';
 }
开发者ID:walkthenight,项目名称:walkthenight-wordpress,代码行数:17,代码来源:vc_template_manager.php


注:本文中的vc_settings函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。