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


PHP WPBakeryShortCode类代码示例

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


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

示例1: etheme_teaser

    function etheme_teaser($atts, $content = null)
    {
        $title = $grid_columns_count = $grid_teasers_count = $grid_layout = $grid_link = $grid_link_target = $pagination = '';
        $grid_template = $grid_thumb_size = $grid_posttypes = $grid_taxomonies = $grid_categories = $posts_in = $posts_not_in = '';
        $grid_content = $el_class = $width = $orderby = $order = $el_position = $isotope_item = $isotope_class = $posted_by = $posted_block = $hover_mask = $border = '';
        extract(shortcode_atts(array('title' => '', 'grid_columns_count' => 4, 'grid_teasers_count' => 8, 'grid_layout' => 'title_thumbnail_text', 'grid_link' => 'link_post', 'grid_link_target' => '_self', 'grid_template' => 'grid', 'grid_thumb_size' => '500x300', 'grid_posttypes' => '', 'border' => 'on', 'pagination' => 'show', 'posted_block' => 'show', 'hover_mask' => 'show', 'grid_taxomonies' => '', 'grid_categories' => '', 'posts_in' => '', 'posts_not_in' => '', 'grid_content' => 'teaser', 'el_class' => '', 'width' => '1/1', 'orderby' => NULL, 'order' => 'DESC', 'el_position' => ''), $atts));
        if ($grid_template == 'grid' || $grid_template == 'filtered_grid') {
            $isotope_item = 'et_isotope-item ';
        } else {
            if ($grid_template == 'carousel') {
                $isotope_item = '';
            }
        }
        $output = '';
        $el_class = WPBakeryShortCode::getExtraClass($el_class);
        $width = '';
        //wpb_translateColumnWidthToSpan( $width );
        $col = 12 / $grid_columns_count;
        $li_span_class = 'col-lg-' . $col;
        $query_args = array();
        $paged = get_query_var('paged') ? get_query_var('paged') : 1;
        if (is_front_page()) {
            $paged = get_query_var('page') ? get_query_var('page') : 1;
        }
        $query_args['paged'] = $paged;
        $not_in = array();
        if ($posts_not_in != '') {
            $posts_not_in = str_ireplace(" ", "", $posts_not_in);
            $not_in = explode(",", $posts_not_in);
        }
        $link_target = $grid_link_target == '_blank' ? ' target="_blank"' : '';
        //exclude current post/page from query
        if ($posts_in == '') {
            global $post;
            array_push($not_in, $post->ID);
        } else {
            if ($posts_in != '') {
                $posts_in = str_ireplace(" ", "", $posts_in);
                $query_args['post__in'] = explode(",", $posts_in);
            }
        }
        if ($posts_in == '' || $posts_not_in != '') {
            $query_args['post__not_in'] = $not_in;
        }
        // Post teasers count
        if ($grid_teasers_count != '' && !is_numeric($grid_teasers_count)) {
            $grid_teasers_count = -1;
        }
        if ($grid_teasers_count != '' && is_numeric($grid_teasers_count)) {
            $query_args['posts_per_page'] = $grid_teasers_count;
        }
        // Post types
        $pt = array();
        if ($grid_posttypes != '') {
            $grid_posttypes = explode(",", $grid_posttypes);
            foreach ($grid_posttypes as $post_type) {
                array_push($pt, $post_type);
            }
            $query_args['post_type'] = $pt;
        }
        // Taxonomies
        $taxonomies = array();
        if ($grid_taxomonies != '') {
            $grid_taxomonies = explode(",", $grid_taxomonies);
            foreach ($grid_taxomonies as $taxom) {
                array_push($taxonomies, $taxom);
            }
        }
        // Narrow by categories
        if ($grid_categories != '') {
            $grid_categories = explode(",", $grid_categories);
            $gc = array();
            foreach ($grid_categories as $grid_cat) {
                array_push($gc, $grid_cat);
            }
            $gc = implode(",", $gc);
            ////http://snipplr.com/view/17434/wordpress-get-category-slug/
            $query_args['category_name'] = $gc;
            $taxonomies = get_taxonomies('', 'object');
            $query_args['tax_query'] = array('relation' => 'OR');
            foreach ($taxonomies as $t) {
                if (in_array($t->object_type[0], $pt)) {
                    $query_args['tax_query'][] = array('taxonomy' => $t->name, 'terms' => $grid_categories, 'field' => 'slug');
                }
            }
        }
        // Order posts
        if ($orderby != NULL) {
            $query_args['orderby'] = $orderby;
        }
        $query_args['order'] = $order;
        // Run query
        $my_query = new WP_Query($query_args);
        //global $_wp_additional_image_sizes;
        $teasers = '';
        $teaser_categories = array();
        if ($grid_template == 'filtered_grid' && empty($grid_taxomonies)) {
            $taxonomies = get_object_taxonomies(!empty($query_args['post_type']) ? $query_args['post_type'] : get_post_types(array('public' => false, 'name' => 'attachment'), 'names', 'NOT'));
        }
        if ($posted_block == 'show') {
//.........这里部分代码省略.........
开发者ID:EmmaTope,项目名称:gadafunds,代码行数:101,代码来源:theme-functions.php

示例2: __construct

 public function __construct($settings)
 {
     parent::__construct($settings);
     if (!self::$filter_added) {
         $this->addFilter('vc_inline_template_content', 'setCustomTabId');
         self::$filter_added = true;
     }
 }
开发者ID:evanbuss,项目名称:wordpress,代码行数:8,代码来源:vc-tabs.php

示例3:

	function __construct( $settings ) {
		parent::__construct( $settings );
	}
开发者ID:verbazend,项目名称:AWFA,代码行数:3,代码来源:vc-posts-grid.php

示例4:

 function __construct($settings)
 {
     parent::__construct($settings);
     $this->jsScripts();
 }
开发者ID:VitaAprel,项目名称:mynotebook,代码行数:5,代码来源:vc-single-image.php

示例5:

 function __construct($settings)
 {
     parent::__construct($settings);
     $this->addAction('admin_init', 'jsComposerEditPage', 6);
 }
开发者ID:ksingh812,项目名称:thub-old,代码行数:5,代码来源:posts_grid.php

示例6: __construct

 public function __construct($settings)
 {
     parent::__construct($settings);
     $this->addAction('wp_enqueue_scripts', 'jsScripts');
 }
开发者ID:jjmas,项目名称:jjmas.net,代码行数:5,代码来源:pie.php

示例7:

 function __construct($settings)
 {
     parent::__construct($settings);
     $this->shortcodeScripts();
 }
开发者ID:severnrescue,项目名称:web,代码行数:5,代码来源:vc-gallery.php

示例8: enqueueDefaultScripts

 public function enqueueDefaultScripts()
 {
     if (false === self::$default_scripts_enqueued) {
         wp_enqueue_script('wpb_composer_front_js');
         wp_enqueue_style('js_composer_front');
         self::$default_scripts_enqueued = true;
     }
 }
开发者ID:AlchemyMomentum,项目名称:public_html,代码行数:8,代码来源:shortcodes.php

示例9: __construct

 public function __construct($settings)
 {
     parent::__construct($settings);
     $this->wt_sc = new WT_VCSC_SHORTCODE();
 }
开发者ID:panchortuzar,项目名称:revistaemprendedores-shop,代码行数:5,代码来源:wt_vcsc_custom_heading.php

示例10: __construct

 public function __construct($settings)
 {
     parent::__construct($settings);
     // WPBakeryVisualComposer::getInstance()->addShortCode( array( 'base' => 'vc_tab' ) );
 }
开发者ID:unisexx,项目名称:drtooth,代码行数:5,代码来源:nested_tabs.php

示例11: loadTemplate

 protected function loadTemplate($atts, $content = null)
 {
     if ($this->shortcode !== 'dhvc_form_submit_button') {
         extract(shortcode_atts(array('control_name' => ''), $atts), EXTR_SKIP);
         if (empty($control_name)) {
             return __('Field name is required', DHVC_FORM);
         }
     }
     return parent::loadTemplate($atts, $content);
 }
开发者ID:mysia84,项目名称:mnassalska,代码行数:10,代码来源:shortcodes.php

示例12: __construct

 public function __construct($settings)
 {
     parent::__construct($settings);
     wp_enqueue_style('tm-polygon-swipebox');
     wp_enqueue_script('tm-polygon-swipebox');
 }
开发者ID:novichkovv,项目名称:prlab,代码行数:6,代码来源:vc-extend.php

示例13: __construct

 public function __construct($settings)
 {
     parent::__construct($settings);
     // !Important to call parent constructor to active all logic for shortcode.
     $this->jsCssScripts();
 }
开发者ID:rtenshi,项目名称:vc-dev-example,代码行数:6,代码来源:test_vc_map.php


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