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


PHP WPBakeryVisualComposerSettings类代码示例

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


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

示例1: getDownloadUrl

 protected function getDownloadUrl()
 {
     global $wp_filesystem;
     $this->skin->feedback('download_envato');
     $package_filename = 'js_composer.zip';
     $res = $this->fs_connect(array(WP_CONTENT_DIR));
     if (!$res) {
         return new WP_Error('no_credentials', __("Error! Can't connect to filesystem", 'js_composer'));
     }
     $username = WPBakeryVisualComposerSettings::get('envato_username');
     $api_key = WPBakeryVisualComposerSettings::get('envato_api_key');
     $purchase_code = WPBakeryVisualComposerSettings::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=wpb_vc_settings&tab=updater') . '' . '">Settings</a> to fix.', 'js_composer'));
     }
     $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'] : '.'), 'js_composer'));
     }
     $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() . 'upgrade_tmp/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', 'js_composer'));
 }
开发者ID:m-godefroid76,项目名称:devrestofactory,代码行数:35,代码来源:wpb_automatic_updater.php

示例2: getSettings

 public 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 = WPBakeryVisualComposerSettings::get('groups_access_rules');
     }
     return self::$settings;
 }
开发者ID:ConceptHaus,项目名称:huasca,代码行数:19,代码来源:mapper.php

示例3: output

 public function output($post = null)
 {
     global $current_user;
     get_currentuserinfo();
     /** @var $settings - get use group access rules */
     $settings = WPBakeryVisualComposerSettings::get('groups_access_rules');
     $role = $current_user->roles[0];
     $show_role = isset($settings[$role]['show']) ? $settings[$role]['show'] : '';
     $buttons = $this->buildButtons();
     $output = '
         <div id="wpb_visual_composer-elements" class="vc_navbar">
             <input type="hidden" name="wpb_js_composer_group_access_show_rule" class="wpb_js_composer_group_access_show_rule" value="' . $show_role . '" />
             <div class="vc_navbar-inner clearfix">
                 <!--<div class="container">-->
                     <ul class="vc_nav">
                       <li>
                         <a title="' . __('Visual Composer for WordPress', LANGUAGE_ZONE) . '" href="http://vc.wpbakery.com/" class="vc_logo" target="_blank"></a>
                       </li>
                     </ul>
                     ' . $buttons . '
                 <!--</div>-->
             </div>
         </div>';
     return $output;
 }
开发者ID:scottnkerr,项目名称:eeco,代码行数:25,代码来源:layouts.php

示例4: get_custom_column_class

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

示例5: elementBackendHtml

	/**
	 * Create shortcode's string.
	 *
	 * @since  3.0
	 * @access public
	 * @deprecated
	 */
	public function elementBackendHtml() {
		global $current_user;
		get_currentuserinfo();
		$data_element = vc_post_param( 'data_element' );

		/** @xvar $settings - get use group access rules */
		$settings = WPBakeryVisualComposerSettings::get( 'groups_access_rules' );
		$role = $current_user->roles[0];

		if ( $data_element == 'vc_column' && vc_post_param( 'data_width' ) !== null ) {
			$output = do_shortcode( '[vc_column width="' . vc_post_param( 'data_width' ) . '"]' );
			echo $output;
		} elseif ( $data_element == 'vc_row' || $data_element == 'vc_row_inner' ) {
			$output = do_shortcode( '[' . $data_element . ']' );
			echo $output;
		} elseif ( ! isset( $settings[$role]['shortcodes'] ) || ( isset( $settings[$role]['shortcodes'][$data_element] ) && (int)$settings[$role]['shortcodes'][$data_element] == 1 ) ) {
			$output = do_shortcode( '[' . $data_element . ']' );
			echo $output;
		}
		die();
	}
开发者ID:verbazend,项目名称:AWFA,代码行数:28,代码来源:class-vc-backend-editor.php

示例6: elementBackendHtml

 /**
  * Create shortcode's string.
  *
  * @since  3.0
  * @access public
  * @deprecated
  */
 public function elementBackendHtml()
 {
     global $current_user;
     get_currentuserinfo();
     if (!vc_verify_admin_nonce() || !current_user_can('edit_posts') && !current_user_can('edit_pages')) {
         wp_send_json(array('success' => false));
     }
     $data_element = vc_post_param('data_element');
     /** @var $settings - get use group access rules */
     $settings = WPBakeryVisualComposerSettings::get('groups_access_rules');
     $role = $current_user->roles[0];
     if ($data_element === 'vc_column' && vc_post_param('data_width') !== null) {
         $output = do_shortcode('[vc_column width="' . vc_post_param('data_width') . '"]');
         echo $output;
     } elseif ($data_element == 'vc_row' || $data_element == 'vc_row_inner' || $data_element == 'mk_page_section') {
         $output = do_shortcode('[' . $data_element . ']');
         echo $output;
     } elseif (!isset($settings[$role]['shortcodes']) || isset($settings[$role]['shortcodes'][$data_element]) && (int) $settings[$role]['shortcodes'][$data_element] === 1) {
         $output = do_shortcode('[' . $data_element . ']');
         echo $output;
     }
     die;
 }
开发者ID:kaydwithers,项目名称:crossfittanjongpagar,代码行数:30,代码来源:class-vc-backend-editor.php

示例7: removeSettingsNotificationJavascript_callback

 public function removeSettingsNotificationJavascript_callback()
 {
     WPBakeryVisualComposerSettings::removeNotification();
 }
开发者ID:nhatnam1102,项目名称:wp-content,代码行数:4,代码来源:composer.php

示例8: output

 public function output($post = null)
 {
     global $current_user;
     get_currentuserinfo();
     /** @var $settings - get use group access rules */
     $settings = WPBakeryVisualComposerSettings::get('groups_access_rules');
     $role = $current_user->roles[0];
     $show_role = isset($settings[$role]['show']) ? $settings[$role]['show'] : '';
     $output = '
         <div id="wpb_visual_composer-elements" class="navbar">
             <input type="hidden" name="wpb_js_composer_group_access_show_rule" class="wpb_js_composer_group_access_show_rule" value="' . $show_role . '" />
             <div class="navbar-inner">
                 <div class="container">
                     <a title="' . __('Visual Composer for WordPress', 'js_composer') . '" href="http://wpbakery.com/vc/" class="brand" target="_blank"></a>
                     <div class="nav-collapse">
                         <ul class="nav">
                             <li class="dropdown wpb_deprecated_element">
                                 <a data-toggle="dropdown" class="dropdown-toggle wpb_popular_layouts" href="#">' . __("Popular Layouts", "js_composer") . ' <b class="caret"></b></a>
                                 <ul class="dropdown-menu">
                                     ' . $this->getColumnLayouts() . '
                                 </ul>
                             </li>
                             <li class="dropdown wpb_deprecated_element">
                                 <a data-toggle="dropdown" class="dropdown-toggle wpb_content_elements" href="#">' . __("Content Elements", "js_composer") . ' <b class="caret"></b></a>
                                 <ul class="dropdown-menu wpb-content-layouts-container">
                                     ' . $this->getContentCategoriesLayouts() . '
                                     ' . $this->getContentLayouts() . '
                                 </ul>
                             </li>
                             <li>
                                 <a class="wpb_add_new_element dropable_el button" id="wpb-add-new-element"><i class="icon"></i>' . __('Add element', 'js_composer') . '</a>
                             </li>
                         </ul>
                         <ul class="nav"><li>
                             <a class="wpb_add_new_row dropable_row button" id="wpb-add-new-row" data-element="vc_row"><i class="icon"></i>' . __('Add row', 'js_composer') . '</a>
                         </li></ul>
                         <ul class="nav">
                             <li class="dropdown">
                                 <a data-toggle="dropdown" class="wpb_templates button" href="#"><i class="icon"></i>' . __('Templates', 'js_composer') . ' <b class="caret"></b></a>
                                 <ul class="dropdown-menu wpb_templates_ul">
                                     ' . $this->getTemplateMenu() . '
                                 </ul>
                             </li>
                         </ul>
                         <ul class="nav pull-right wpb-update-button">
                             <li><a class="button" id="wpb-save-post">' . __('Update', 'jscomposer') . '</a></li>
                         </ul>
                     </div><!-- /.nav-collapse -->
                 </div>
             </div>
         </div>
         <style type="text/css">#wpb_visual_composer {display: none;}</style>';
     return $output;
 }
开发者ID:unisexx,项目名称:drtooth,代码行数:54,代码来源:layouts.php

示例9: addThemeBodyClass

 /**
  * Adds themes css class to body tag.
  * @param $classes
  * @return array
  */
 public function addThemeBodyClass($classes)
 {
     if (!class_exists('WPBakeryVisualComposerSettings')) {
         return $classes;
     }
     $theme = ($theme = get_option(WPBakeryVisualComposerSettings::getFieldPrefix() . 'themes')) ? $theme : '';
     if (!empty($theme)) {
         $classes[] = 'vct_' . preg_replace('/\\.css$/', '', $theme);
     }
     return $classes;
 }
开发者ID:jfbelisle,项目名称:magexpress,代码行数:16,代码来源:vc_template_manager.php

示例10: 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 = WPBakeryVisualComposerSettings::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(), $this->composer->getPostTypes());
 }
开发者ID:roycocup,项目名称:enclothed,代码行数:18,代码来源:editor.php

示例11: setUpPlugin

 public function setUpPlugin()
 {
     global $current_user;
     get_currentuserinfo();
     /** @var $settings - get use group access rules */
     $settings = WPBakeryVisualComposerSettings::get('groups_access_rules');
     parent::setUpPlugin();
     $show = true;
     foreach ($current_user->roles as $role) {
         if (isset($settings[$role]['show']) && $settings[$role]['show'] === 'no') {
             $show = false;
             break;
         }
     }
     if ($show) {
         $this->composer->addAction('edit_post', 'saveMetaBoxes');
         $this->composer->addAction('wp_ajax_wpb_get_element_backend_html', 'elementBackendHtmlJavascript_callback');
         $this->composer->addAction('wp_ajax_wpb_get_convert_elements_backend_html', 'Convert2NewVersionJavascript_callback');
         $this->composer->addAction('wp_ajax_wpb_get_row_element_backend_html', 'elementRowBackendHtmlJavascript_callback');
         $this->composer->addAction('wp_ajax_wpb_shortcodes_to_visualComposer', 'shortCodesVisualComposerJavascript_callback');
         $this->composer->addAction('wp_ajax_wpb_show_edit_form', 'showEditFormJavascript_callback');
         $this->composer->addAction('wp_ajax_wpb_save_template', 'saveTemplateJavascript_callback');
         $this->composer->addAction('wp_ajax_wpb_load_template', 'loadTemplateJavascript_callback');
         $this->composer->addAction('wp_ajax_wpb_delete_template', 'deleteTemplateJavascript_callback');
         $this->addAction('admin_init', 'jsComposerEditPage', 5);
     }
     // Add specific CSS class by filter
     $this->addFilter('body_class', 'jsComposerBodyClass');
     $this->addFilter('get_media_item_args', 'jsForceSend');
     $this->addAction('admin_init', 'composerRedirect');
     $this->addAction('admin_init', 'registerCss');
     $this->addAction('admin_init', 'registerJavascript');
     $this->addAction('admin_menu', 'composerSettings');
     $this->addAction('admin_print_scripts-post.php', 'editScreen_js');
     $this->addAction('admin_print_scripts-post-new.php', 'editScreen_js');
     /* Create Media tab for images */
     $this->composer->createImagesMediaTab();
 }
开发者ID:unisexx,项目名称:drtooth,代码行数:38,代码来源:build.php

示例12: esc_attr_e

        <ul class="nav navbar-nav navbar-right">
            <li class="line"></li>
            <li><a id="vc-post-settings-button" class="vc_post_settings" title="<?php 
esc_attr_e('Page settings', LANGUAGE_ZONE);
?>
"><i class="icon"></i></a></li>
            <li class="line"></li>
            <li><button id="vc-guides-toggle-button" class="btn-primary btn navbar-btn btn-sm vc_guides_toggle" title="<?php 
esc_attr_e("Toggle editor's guides", LANGUAGE_ZONE);
?>
"><?php 
_e('Guides ON', LANGUAGE_ZONE);
?>
</button></li>
            <?php 
$disable_responsive = WPBakeryVisualComposerSettings::get('not_responsive_css');
if ($disable_responsive !== '1') {
    ?>
            <li class="line"></li>
            <li>
                <div class="vc-dropdown" id="vc-screen-size-control">
                    <a href="#" class="vc-dropdown-toggle" title="<?php 
    _e("Responsive preview", LANGUAGE_ZONE);
    ?>
"><i class="icon default" id="vc-screen-size-current"></i><b class="caret"></b></a>
                    <ul class="vc-dropdown-list">
                        <li><a href="#" title="<?php 
    esc_attr_e('Desktop', LANGUAGE_ZONE);
    ?>
" class="vc-screen-width active default" data-size="100%"></a></li>
                        <li><a href="#" title="<?php 
开发者ID:Alderx,项目名称:publioriente,代码行数:31,代码来源:editor.tpl.php

示例13: elementRowBackendHtmlJavascript_callback

 public function elementRowBackendHtmlJavascript_callback()
 {
     global $current_user;
     get_currentuserinfo();
     $data_element = $this->post('data_element');
     $data_width = $this->post('data_width');
     /** @var $settings - get use group access rules */
     $settings = WPBakeryVisualComposerSettings::get('groups_access_rules');
     $role = $current_user->roles[0];
     if ($data_element == 'vc_column') {
         $output = do_shortcode('[vc_row][vc_column width="' . ($data_width ? $data_width : '1/1') . '"][/vc_row]');
         echo $output;
     } elseif (!isset($settings[$role]['shortcodes']) || isset($settings[$role]['shortcodes'][$data_element]) && (int) $settings[$role]['shortcodes'][$data_element] == 1) {
         $output = do_shortcode('[vc_row][vc_column width="1/1"][' . $data_element . '][/vc_column][/vc_row]');
         echo $output;
     }
     die;
 }
开发者ID:unisexx,项目名称:drtooth,代码行数:18,代码来源:composer.php

示例14: activateLicense

 public function activateLicense()
 {
     $params = array();
     $params['username'] = $this->post('username');
     $params['key'] = $this->post('key');
     $params['api_key'] = $this->post('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->setDeactivationLicense(isset($result->code) && (int) $result->code === 401 ? $result->deactivation_key : $params['dkey']);
         update_option(WPBakeryVisualComposerSettings::getFieldPrefix() . 'envato_username', $params['username']);
         update_option(WPBakeryVisualComposerSettings::getFieldPrefix() . 'envato_api_key', $params['api_key']);
         update_option(WPBakeryVisualComposerSettings::getFieldPrefix() . 'js_composer_purchase_code', $params['key']);
         echo json_encode(array('result' => true));
         die;
     }
     echo $response['body'];
     die;
 }
开发者ID:venamax,项目名称:trixandtrax-cl,代码行数:32,代码来源:composer.php

示例15: setUpPlugin

 public function setUpPlugin()
 {
     global $current_user;
     get_currentuserinfo();
     /** @var $settings - get use group access rules */
     $settings = WPBakeryVisualComposerSettings::get('groups_access_rules');
     parent::setUpPlugin();
     $show = true;
     foreach ($current_user->roles as $role) {
         if (isset($settings[$role]['show']) && $settings[$role]['show'] === 'no') {
             $show = false;
             break;
         }
     }
     if ($show) {
         $this->composer->addAction('edit_post', 'saveMetaBoxes');
         $this->composer->addAction('wp_ajax_wpb_get_element_backend_html', 'elementBackendHtmlJavascript_callback');
         $this->composer->addAction('wp_ajax_wpb_get_convert_elements_backend_html', 'Convert2NewVersionJavascript_callback');
         $this->composer->addAction('wp_ajax_wpb_get_row_element_backend_html', 'elementRowBackendHtmlJavascript_callback');
         $this->composer->addAction('wp_ajax_wpb_shortcodes_to_visualComposer', 'shortCodesVisualComposerJavascript_callback');
         $this->composer->addAction('wp_ajax_wpb_single_image_src', 'singleImageSrcJavascript_callback');
         $this->composer->addAction('wp_ajax_wpb_gallery_html', 'galleryHTMLJavascript_callback');
         $this->composer->addAction('wp_ajax_wpb_get_loop_suggestion', 'getLoopSuggestionJavascript_callback');
         $this->composer->addAction('wp_ajax_wpb_remove_settings_notification_element_css_class', 'removeSettingsNotificationJavascript_callback');
         $this->composer->addAction('wp_ajax_wpb_image_url', 'getImageUrlByIdJavascript_callback');
         /*
          * Create edit form html
          * @deprecated
          */
         $this->composer->addAction('wp_ajax_wpb_show_edit_form', 'showEditFormJavascript_callback');
         $this->composer->addAction('wp_ajax_wpb_get_edit_form', 'getEditFormJavascript_callback');
         $this->composer->addAction('wp_ajax_wpb_save_template', 'saveTemplateJavascript_callback');
         $this->composer->addAction('wp_ajax_wpb_load_template', 'loadTemplateJavascript_callback');
         $this->composer->addAction('wp_ajax_wpb_load_template_shortcodes', 'loadTemplateShortcodesJavascript_callback');
         $this->composer->addAction('wp_ajax_wpb_delete_template', 'deleteTemplateJavascript_callback');
         $this->composer->addAction('wp_ajax_wpb_get_loop_settings', 'getLoopSettingsJavascript_callback');
         $this->composer->addAction('wp_ajax_wpb_activate_license', 'activateLicense');
         $this->composer->addAction('wp_ajax_wpb_deactivate_license', 'deactivateLicense');
         $this->addAction('admin_init', 'jsComposerEditPage', 5);
     }
     // Add specific CSS class by filter
     $this->addFilter('body_class', 'jsComposerBodyClass');
     $this->addFilter('get_media_item_args', 'jsForceSend');
     $this->addAction('admin_init', 'composerRedirect');
     $this->addAction('admin_init', 'registerCss');
     $this->addAction('admin_init', 'registerJavascript');
     if ($this->composer->isNetworkPlugin() && is_network_admin()) {
         $this->addAction('network_admin_menu', 'composerSettings');
     }
     $this->addAction('admin_menu', 'composerSettings');
     $this->addAction('admin_print_scripts-post.php', 'editScreen_js');
     $this->addAction('admin_print_scripts-post-new.php', 'editScreen_js');
     // Upgrade message in plugins list.
     if ($this->composer->updaterDisabled()) {
         return $this;
     }
     $plugin_file_name = 'js_composer/js_composer.php';
     new WpbAutoUpdate(WPB_VC_VERSION, 'http://wpbakery.com/version/?' . time(), $plugin_file_name);
     $this->addAction('in_plugin_update_message-' . $plugin_file_name, 'addUpgradeMessageLink');
 }
开发者ID:jjmas,项目名称:jjmas.net,代码行数:60,代码来源:build.php


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