本文整理汇总了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') {
//.........这里部分代码省略.........
示例2: __construct
public function __construct($settings)
{
parent::__construct($settings);
if (!self::$filter_added) {
$this->addFilter('vc_inline_template_content', 'setCustomTabId');
self::$filter_added = true;
}
}
示例3:
function __construct( $settings ) {
parent::__construct( $settings );
}
示例4:
function __construct($settings)
{
parent::__construct($settings);
$this->jsScripts();
}
示例5:
function __construct($settings)
{
parent::__construct($settings);
$this->addAction('admin_init', 'jsComposerEditPage', 6);
}
示例6: __construct
public function __construct($settings)
{
parent::__construct($settings);
$this->addAction('wp_enqueue_scripts', 'jsScripts');
}
示例7:
function __construct($settings)
{
parent::__construct($settings);
$this->shortcodeScripts();
}
示例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;
}
}
示例9: __construct
public function __construct($settings)
{
parent::__construct($settings);
$this->wt_sc = new WT_VCSC_SHORTCODE();
}
示例10: __construct
public function __construct($settings)
{
parent::__construct($settings);
// WPBakeryVisualComposer::getInstance()->addShortCode( array( 'base' => 'vc_tab' ) );
}
示例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);
}
示例12: __construct
public function __construct($settings)
{
parent::__construct($settings);
wp_enqueue_style('tm-polygon-swipebox');
wp_enqueue_script('tm-polygon-swipebox');
}
示例13: __construct
public function __construct($settings)
{
parent::__construct($settings);
// !Important to call parent constructor to active all logic for shortcode.
$this->jsCssScripts();
}