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


PHP VcShortcodeAutoloader类代码示例

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


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

示例1: getControlAnimationList

 public function getControlAnimationList()
 {
     VcShortcodeAutoloader::getInstance()->includeClass('WPBakeryShortCode_VC_Gitem_Animated_Block');
     $output = '';
     $animations = WPBakeryShortCode_VC_Gitem_Animated_Block::animations();
     if (is_array($animations)) {
         $output .= '<li class="vc_pull-right vc_gitem-navbar-dropdown">' . '<select data-vc-navbar-control="animation">';
         foreach ($animations as $value => $key) {
             $output .= '<option value="' . esc_attr($key) . '">' . esc_html($value) . '</option>';
         }
         $output .= '</select></li>';
     }
     return $output;
 }
开发者ID:severnrescue,项目名称:web,代码行数:14,代码来源:class-vc-navbar-grid-item.php

示例2: enqueue

 public function enqueue()
 {
     visual_composer()->frontCss();
     visual_composer()->frontJsRegister();
     wp_enqueue_script('prettyphoto');
     wp_enqueue_style('prettyphoto');
     wp_enqueue_style('js_composer_front');
     wp_enqueue_script('wpb_composer_front_js');
     wp_enqueue_style('js_composer_custom_css');
     VcShortcodeAutoloader::getInstance()->includeClass('WPBakeryShortCode_VC_Basic_Grid');
     $grid = new WPBakeryShortCode_VC_Basic_Grid(array('base' => 'vc_basic_grid'));
     $grid->shortcodeScripts();
     $grid->enqueueScripts();
 }
开发者ID:Junaid-Farid,项目名称:gocnex,代码行数:14,代码来源:class-vc-grid-item-preview.php

示例3: array

<?php

VcShortcodeAutoloader::getInstance()->includeClass('WPBakeryShortCode_VC_Single_image');
$atts = array();
parse_str($data, $atts);
$el_class = $image = $img_size = $img_link = $img_link_target = $img_link_large = $title = $alignment = $css_animation = $css = '';
$image_string = '';
$img_class = new WPBakeryShortCode_VC_Single_image(array('base' => 'vc_single_image'));
/** @var $img_class WPBakeryShortCode_VC_Single_image */
$atts = vc_map_get_attributes($img_class->getShortcode(), $atts);
extract($atts);
$style = '' !== $style ? $style : '';
$border_color = '' !== $border_color ? ' vc_box_border_' . $border_color : '';
$img_id = get_post_thumbnail_id($post->ID);
$img = wpb_getImageBySize(array('attach_id' => $img_id, 'thumb_size' => $img_size, 'class' => 'vc_single_image-img'));
$img = apply_filters('vc_gitem_attribute_featured_image_img', $img);
if (null === $img || false === $img) {
    return '';
}
$el_class = $img_class->getExtraClass($el_class);
$wrapperClass = 'vc_single_image-wrapper ' . $style . ' ' . $border_color;
$link = vc_gitem_create_link_real($atts, $post, '', $title);
$image_string = !empty($link) ? '<' . $link . '>' . $img['thumbnail'] . '</a>' : '<div class="' . $wrapperClass . '">' . $img['thumbnail'] . '</div>';
$css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'wpb_single_image wpb_content_element' . $el_class . vc_shortcode_custom_css_class($css, ' '), $img_class->settings('base'), $atts);
$css_class .= $img_class->getCSSAnimation($css_animation);
$css_class .= ' vc_align_' . $alignment;
$output = '
	<div class="' . $css_class . '">
		<figure class="wpb_wrapper vc_figure">
			' . $image_string . '
		</figure>
开发者ID:severnrescue,项目名称:web,代码行数:31,代码来源:featured_image.php

示例4: die

<?php

if (!defined('ABSPATH')) {
    die('-1');
}
if ('vc_edit_form' === vc_post_param('action')) {
    VcShortcodeAutoloader::getInstance()->includeClass('WPBakeryShortCode_VC_Wp_Text');
    add_filter('vc_edit_form_fields_attributes_vc_wp_text', array('WPBakeryShortCode_VC_Wp_Text', 'convertTextAttributeToContent'));
}
开发者ID:mazykin46,项目名称:portfolio,代码行数:9,代码来源:hook-vc-wp-text.php

示例5: die

<?php

if (!defined('ABSPATH')) {
    die('-1');
}
VcShortcodeAutoloader::getInstance()->includeClass('WPBakeryShortCode_VC_Progress_Bar');
add_filter('vc_edit_form_fields_attributes_vc_progress_bar', array('WPBakeryShortCode_VC_Progress_Bar', 'convertAttributesToNewProgressBar'));
开发者ID:swc-dng,项目名称:swcsandbox,代码行数:7,代码来源:hook-vc-progress-bar.php

示例6: getTtaGeneralClasses

<?php

VcShortcodeAutoloader::getInstance()->includeClass('WPBakeryShortCode_VC_Tta_Accordion');
class WPBakeryShortCode_VC_Tta_Tour extends WPBakeryShortCode_VC_Tta_Tabs
{
    public $layout = 'tabs';
    public function getTtaGeneralClasses()
    {
        $classes = parent::getTtaGeneralClasses();
        if (isset($this->atts['controls_size'])) {
            $classes .= ' ' . $this->getTemplateVariable('controls_size');
        }
        return $classes;
    }
    /**
     * @param $atts
     * @param $content
     *
     * @return string|null
     */
    public function getParamControlsSize($atts, $content)
    {
        if (isset($atts['controls_size']) && strlen($atts['controls_size']) > 0) {
            return 'vc_tta-controls-size-' . $atts['controls_size'];
        }
        return null;
    }
    /**
     * @param $atts
     * @param $content
     *
开发者ID:severnrescue,项目名称:web,代码行数:31,代码来源:vc-tta-tour.php

示例7: shortcodeClass

 /**
  * @return WPBakeryShortCodeFishBones
  */
 public function shortcodeClass()
 {
     if (false !== $this->shortcode_class) {
         return $this->shortcode_class;
     }
     require_once vc_path_dir('SHORTCODES_DIR', 'wordpress-widgets.php');
     $class_name = $this->settings('php_class_name') ? $this->settings('php_class_name') : 'WPBakeryShortCode_' . $this->settings('base');
     $autoloaded_dependencies = VcShortcodeAutoloader::getInstance()->includeClass($class_name);
     if (!$autoloaded_dependencies) {
         $file = vc_path_dir('SHORTCODES_DIR', str_replace('_', '-', $this->settings('base')) . '.php');
         if (is_file($file)) {
             require_once $file;
         }
     }
     if (class_exists($class_name) && is_subclass_of($class_name, 'WPBakeryShortCode')) {
         $this->shortcode_class = new $class_name($this->settings);
     } else {
         $this->shortcode_class = $this;
     }
     return $this->shortcode_class;
 }
开发者ID:AlchemyMomentum,项目名称:public_html,代码行数:24,代码来源:shortcodes.php

示例8: getElementClass

 public function getElementClass($tag)
 {
     if (isset($this->shortcode_classes[$tag])) {
         return $this->shortcode_classes[$tag];
     }
     $settings = WPBMap::getShortCode($tag);
     require_once vc_path_dir('SHORTCODES_DIR', 'wordpress-widgets.php');
     $class_name = !empty($settings['php_class_name']) ? $settings['php_class_name'] : 'WPBakeryShortCode_' . $tag;
     $autoloaded_dependencies = VcShortcodeAutoloader::getInstance()->includeClass($class_name);
     if (!$autoloaded_dependencies) {
         $file = vc_path_dir('SHORTCODES_DIR', str_replace('_', '-', $tag) . '.php');
         if (is_file($file)) {
             require_once $file;
         }
     }
     if (class_exists($class_name) && is_subclass_of($class_name, 'WPBakeryShortCode')) {
         $shortcode_class = new $class_name($settings);
     } else {
         $shortcode_class = new WPBakeryShortCodeFishBones($settings);
     }
     $this->shortcode_classes[$tag] = $shortcode_class;
     return $shortcode_class;
 }
开发者ID:websideas,项目名称:aquila,代码行数:23,代码来源:shortcodes.php

示例9: array

<?php

VcShortcodeAutoloader::getInstance()->includeClass('WPBakeryShortCode_Vc_Pie');
add_filter('vc_edit_form_fields_attributes_vc_pie', array('WPBakeryShortCode_VC_Pie', 'convertOldColorsToNew'));
开发者ID:hikaram,项目名称:wee,代码行数:4,代码来源:hook-vc-pie.php

示例10: getParamPaginationList

 /**
  * @param $atts
  * @param $content
  *
  * @return string
  */
 public function getParamPaginationList($atts, $content)
 {
     if (empty($atts['pagination_style'])) {
         return null;
     }
     $isPageEditabe = vc_is_page_editable();
     $sectionClass = $this->sectionClass;
     $html = array();
     $html[] = '<ul class="' . $this->getTtaPaginationClasses() . '">';
     if (!$isPageEditabe) {
         VcShortcodeAutoloader::getInstance()->includeClass('WPBakeryShortCode_VC_Tta_Section');
         foreach (WPBakeryShortCode_VC_Tta_Section::$section_info as $nth => $section) {
             $strict_bounds = 'vc_tta_tabs' === $this->shortcode;
             $active_section = $this->getActiveSection($atts, $strict_bounds);
             $classes = array('vc_pagination-item');
             if ($nth + 1 === $active_section) {
                 $classes[] = $this->activeClass;
             }
             $a_html = '<a href="#' . $section['tab_id'] . '" class="vc_pagination-trigger" data-vc-tabs data-vc-container=".vc_tta"></a>';
             $html[] = '<li class="' . implode(' ', $classes) . '" data-vc-tab>' . $a_html . '</li>';
         }
     }
     $html[] = '</ul>';
     return implode('', $html);
 }
开发者ID:evanbuss,项目名称:wordpress,代码行数:31,代码来源:vc-tta-accordion.php

示例11: die

<?php

if (!defined('ABSPATH')) {
    die('-1');
}
/**
 * @var $vc_btn WPBakeryShortCode_VC_Gitem_Post_Categories
 * @var $post WP_Post
 * @var $atts
 *
 */
VcShortcodeAutoloader::getInstance()->includeClass('WPBakeryShortCode_VC_Gitem_Post_Categories');
$categories = get_the_category();
$separator = '';
$css_class = array('vc_gitem-post-data');
$css_class[] = vc_shortcode_custom_css_class($atts['css']);
$css_class[] = $atts['el_class'];
$css_class[] = 'vc_gitem-post-data-source-post_categories';
$style = str_replace(',', 'comma', $atts['category_style']);
$output = '<div class="' . esc_attr(implode(' ', array_filter($css_class))) . ' vc_grid-filter vc_clearfix vc_grid-filter-' . esc_attr($style) . ' vc_grid-filter-size-' . esc_attr($atts['category_size']) . ' vc_grid-filter-center vc_grid-filter-color-' . esc_attr($atts['category_color']) . '">';
$data = array();
if (!empty($categories)) {
    foreach ($categories as $category) {
        $category_link = '';
        if (!empty($atts['link'])) {
            $category_link = 'href="' . esc_url(get_category_link($category->term_id)) . '" alt="' . esc_attr(sprintf(__('View all posts in %s', 'js_composer'), $category->name)) . '"';
        }
        $wrapper = '<div class="vc_grid-filter-item vc_gitem-post-category-name">';
        $content = esc_html($category->name);
        if (!empty($category_link)) {
            $content = '<span class="vc_gitem-post-category-name"><a ' . $category_link . ' class="vc_gitem-link">' . $content . '</a>' . '</span>';
开发者ID:websideas,项目名称:aquila,代码行数:31,代码来源:post_categories.php

示例12: getGridDataForAjax

     * @output/@return string - grid data for ajax request.
     */
    public function getGridDataForAjax()
    {
        $tag = vc_request_param('tag');
        $allowed = apply_filters('vc_grid_get_grid_data_access', vc_verify_public_nonce() && $tag, $tag);
        if ($allowed) {
            $shortcode_fishbone = visual_composer()->getShortCode($tag);
            if (is_object($shortcode_fishbone)) {
                /** @var $vc_grid WPBakeryShortcode_Vc_Basic_Grid */
                $vc_grid = $shortcode_fishbone->shortcodeClass();
                if (method_exists($vc_grid, 'isObjectPageable') && $vc_grid->isObjectPageable() && method_exists($vc_grid, 'renderAjax')) {
                    echo $vc_grid->renderAjax(vc_request_param('data'));
                    die;
                }
            }
        }
    }
}
/**
 * @since 4.4
 * @var Vc_Hooks_Vc_Grid $hook
 */
$hook = new Vc_Hooks_Vc_Grid();
// when visual composer initialized let's trigger Vc_Grid hooks.
add_action('vc_after_init', array($hook, 'load'));
VcShortcodeAutoloader::getInstance()->includeClass('WPBakeryShortCode_VC_Basic_Grid');
add_filter('vc_edit_form_fields_attributes_vc_basic_grid', array('WPBakeryShortCode_VC_Basic_Grid', 'convertButton2ToButton3'));
add_filter('vc_edit_form_fields_attributes_vc_media_grid', array('WPBakeryShortCode_VC_Basic_Grid', 'convertButton2ToButton3'));
add_filter('vc_edit_form_fields_attributes_vc_masonry_grid', array('WPBakeryShortCode_VC_Basic_Grid', 'convertButton2ToButton3'));
add_filter('vc_edit_form_fields_attributes_vc_masonry_media_grid', array('WPBakeryShortCode_VC_Basic_Grid', 'convertButton2ToButton3'));
开发者ID:arkev,项目名称:IntelligentMode,代码行数:31,代码来源:hook-vc-grid.php

示例13: __construct

 private function __construct($load_config = true)
 {
     if (!$load_config) {
         return;
     }
     $config = array('classmap_file' => vc_path_dir('APP_ROOT', 'vc_classmap.json.php'), 'shortcodes_dir' => vc_path_dir('SHORTCODES_DIR'), 'root_dir' => vc_path_dir('APP_ROOT'));
     if (is_file($config['classmap_file'])) {
         $config['classmap'] = (require $config['classmap_file']);
         self::$cached = true;
     } else {
         $config['classmap'] = self::generateClassMap($config['shortcodes_dir']);
         self::$cached = false;
     }
     self::$config = $config;
 }
开发者ID:evanbuss,项目名称:wordpress,代码行数:15,代码来源:vc-shortcode-autoloader.php


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