WORDPRESS Missing label in multicolor Kirki field - wordpress

In multicolor field, labels from colour pickers are missing. Code:
Kirki::add_field( $textdomain, [
'type' => 'multicolor',
'settings' => 'multicolor_setting',
'label' => esc_html__( 'Label', $textdomain ),
'section' => 'header__top_bar__general',
'priority' => 10,
'choices' => [
'link' => esc_html__( 'Color', $textdomain ),
'hover' => esc_html__( 'Hover', $textdomain ),
'active' => esc_html__( 'Active', $textdomain ),
],
'default' => [
'link' => '#0088cc',
'hover' => '#00aaff',
'active' => '#00ffff',
],
] );
result:
Console log:
wpColorPickerL10n.defaultLabel is deprecated since version 5.5.0! Use wp.i18n instead.
wpColorPickerL10n.pick is deprecated since version 5.5.0! Use wp.i18n instead.
wpColorPickerL10n.defaultString is deprecated since version 5.5.0! Use wp.i18n instead.
wpColorPickerL10n.defaultAriaLabel is deprecated since version 5.5.0! Use wp.i18n instead.
common.min.js?ver=5.7.1:2
WP 5.7.1, Kirki 3.1.6 from repository, theme_mod
any way to fix quick fix that?

You might be a bit confused here. Why are you using textdomain both as the text domain for the translation AND as the first arguments for add_field? The first argument to the add_field method should be an existing config. As per the documentation:
Kirki::add_config( 'theme_config_id', array(
'capability' => 'edit_theme_options',
'option_type' => 'theme_mod',
) );
Kirki::add_panel( 'panel_id', array(
'priority' => 10,
'title' => esc_html__( 'My Panel', 'kirki' ),
'description' => esc_html__( 'My panel description', 'kirki' ),
) );
Kirki::add_section( 'section_id', array(
'title' => esc_html__( 'My Section', 'kirki' ),
'description' => esc_html__( 'My section description.', 'kirki' ),
'panel' => 'panel_id',
'priority' => 160,
) );
Kirki::add_field( 'theme_config_id', [
'type' => 'multicolor',
'settings' => 'multicolor_setting',
'label' => esc_html__( 'Label', 'kirki' ),
'section' => 'section_id',
'priority' => 10,
'choices' => [
'link' => esc_html__( 'Color', 'kirki' ),
'hover' => esc_html__( 'Hover', 'kirki' ),
'active' => esc_html__( 'Active', 'kirki' ),
],
'default' => [
'link' => '#0088cc',
'hover' => '#00aaff',
'active' => '#00ffff',
],
] );
Here, kirki is an existing text domain. Your text domain seems not to exist. Try removing the text domains. Like this:
$kirki_config_id = '{YOUR KIRKI CONFIG ID}';
Kirki::add_field( $kirki_config_id, [
'type' => 'multicolor',
'settings' => 'multicolor_setting',
'label' => 'Label',
'section' => 'header__top_bar__general',
'priority' => 10,
'choices' => [
'link' => 'Color',
'hover' => 'Hover',
'active' => 'Active',
],
'default' => [
'link' => '#0088cc',
'hover' => '#00aaff',
'active' => '#00ffff',
],
] );
Does that do the trick?

Related

Filtering custom posts on Elementor using the value of a custom field

I am using the Reveal theme to create a listing website and I recently discovered the Advanced Custom Forms (Custom fields).
On my homepage, there is an Elementor block of this Reveal plugin that allows me to display custom posts.
I'd like to adapt an Elementor widget to filter out listings with a value of 1 in the "FreeListing" custom field (basically exclude them).
I saw that this link offered the solution : How to Filter Elementor Posts By a Custom Field's value in wordpress To make a long story short, everyone adds this to add_action, according to my research, but I have never seen this in my home.
But in my code I don't see how to introduce this. Do you know if I'm editing in the wrong place, or if I can do it here?
<?php
namespace Reveal\Core\Elementor\Widgets;
use Elementor\Controls_Manager;
use Elementor\Widget_Base;
class Popular_Listings_TwoNoFreeListing extends Widget_Base {
public function get_name() {
return 'reveal_popular_listings_2';
}
public function get_title() {
return esc_html__( 'Popular Listings No Free', 'reveal-core' );
}
public function get_icon() {
return 'eicon-banner';
}
public function get_categories() {
return array( 'reveal-core' );
}
protected function register_controls() {
$this->start_controls_section(
'general',
array(
'label' => esc_html__( 'General', 'reveal-core' ),
)
);
$this->add_control(
'title',
array(
'label' => esc_html__( 'Title', 'reveal-core' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'default' => __( 'Most Popular Grid', 'reveal-core' ),
)
);
$this->add_control(
'showposts',
array(
'label' => esc_html__( 'Number Of Listing', 'reveal-core' ),
'type' => Controls_Manager::TEXT,
'default' => 6,
)
);
$this->add_control(
'orderby',
array(
'label' => esc_html__( 'Order By', 'reveal-core' ),
'type' => Controls_Manager::SELECT,
'options' => array(
'date' => esc_html__( 'Date', 'reveal-core' ),
'id' => esc_html__( 'ID', 'reveal-core' ),
'title' => esc_html__( 'Title', 'reveal-core' ),
'name' => esc_html__( 'Name', 'reveal-core' ),
'modified' => esc_html__( 'Modified', 'reveal-core' ),
'rand' => esc_html__( 'Random', 'reveal-core' ),
),
'default' => 'date',
)
);
$this->add_control(
'order',
array(
'label' => esc_html__( 'Sort Order', 'reveal-core' ),
'type' => Controls_Manager::SELECT,
'options' => array(
'desc' => esc_html__( 'Descending', 'reveal-core' ),
'asc' => esc_html__( 'Ascending', 'reveal-core' ),
),
'default' => 'desc',
)
);
$this->add_control(
'extra_class',
array(
'label' => esc_html__( 'Extra Class', 'reveal-core' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'default' => 'popular-listing',
)
);
$this->end_controls_section();
$this->start_controls_section(
'style_section',
array(
'label' => __('Color Option', 'reveal-core'),
'tab' => \Elementor\Controls_Manager::TAB_STYLE,
)
);
$this->start_controls_tabs( 'tabs_button_style' );
$this->start_controls_tab(
'tab_button_normal',
array(
'label' => __( 'Normal', 'elementor' ),
)
);
$this->add_control(
'icon_color',
array(
'label' => __('Icon Color', 'reveal-core'),
'separator' => 'before',
'type' => \Elementor\Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .cat-icon i' => 'background: {{VALUE}} !important',
),
)
);
$this->add_control(
'icon_color_two',
array(
'label' => __('Icon Color Two', 'reveal-core'),
'separator' => 'before',
'type' => \Elementor\Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .bg-d' => 'background: {{VALUE}} !important',
),
)
);
$this->add_control(
'rating_color',
array(
'label' => __('Rating Color', 'reveal-core'),
'separator' => 'before',
'type' => \Elementor\Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .property_item .list-rate' => 'background: {{VALUE}} !important',
),
)
);
$this->add_control(
'checkek',
array(
'label' => __('Checked Icon Color', 'reveal-core'),
'separator' => 'before',
'type' => \Elementor\Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} span.veryfied-author:before' => 'background: {{VALUE}} !important',
),
)
);
$this->add_control(
'status_color',
array(
'label' => __('Status Color', 'reveal-core'),
'separator' => 'before',
'type' => \Elementor\Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .place-status.closed' => 'color: {{VALUE}} !important',
),
)
);
$this->end_controls_tab();
$this->start_controls_tab(
'tab_button_hover',
array(
'label' => __( 'Hover', 'elementor' ),
)
);
$this->add_control(
'title_color',
array(
'label' => __('Title Hover Color', 'reveal-core'),
'separator' => 'before',
'type' => \Elementor\Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .proerty_text .captlize a:hover' => 'color: {{VALUE}} !important',
'{{WRAPPER}} .listing-cat a:hover' => 'color: {{VALUE}} !important',
),
)
);
$this->end_controls_tab();
$this->end_controls_tabs();
$this->end_controls_section();
}
protected function render() {
$settings = $this->get_settings_for_display();
$extra_class = $settings['extra_class'];
$title = $settings['title'];
$showposts = $settings['showposts'];
$orderby = $settings['orderby'];
$order = $settings['order'];
$args = array(
'post_type' => 'rlisting',
'post_status' => 'publish',
'showposts' => $showposts,
'orderby' => $orderby,
'order' => $order,
);
$listing_query = new \WP_Query( $args );
?>
<!-- ================ List Grid Style ======================= -->
<section class="<?php echo $extra_class; ?>">
<div class="container">
<div class="row">
<!-- Single List -->
<?php
while ($listing_query->have_posts()) {
$listing_query->the_post();
?>
<div class="col-lg-4 col-md-6 col-sm-12">
<?php
echo do_shortcode('[classical-list-item]');
?>
</div>
<?php
}
?>
</div>
</div>
</section>
<!-- ============================ Listings End ================================== -->
<?php
}
}
Thanks for the help in clarifying

Meta box tabs - in a custom post type

Is it possible to insert meta box tabs in a specific custom post type.
I've been looking at the example :
add_filter( 'rwmb_meta_boxes', function ( $meta_boxes ) {
// 1st Meta Box
$meta_boxes[] = array(
'title' => 'Meta Box Tabs Demo',
// List of tabs, in one of the following formats:
// 1) key => label
// 2) key => array( 'label' => Tab label, 'icon' => Tab icon )
'tabs' => array(
'contact' => array(
'label' => 'Contact',
'icon' => 'dashicons-email', // Dashicon
),
'social' => array(
'label' => 'Social Media',
'icon' => 'dashicons-share', // Dashicon
),
'note' => array(
'label' => 'Note',
'icon' => 'https://i.imgur.com/nJtag1q.png', // Custom icon, using image
),
),
// Tab style: 'default', 'box' or 'left'. Optional
'tab_style' => 'default',
// Show meta box wrapper around tabs? true (default) or false. Optional
'tab_wrapper' => true,
'fields' => array(
array(
'name' => 'Name',
'id' => 'name',
'type' => 'text',
// Which tab this field belongs to? Put tab key here
'tab' => 'contact',
),
array(
'name' => 'Email',
'id' => 'email',
'type' => 'email',
'tab' => 'contact',
),
array(
'name' => 'Facebook',
'id' => 'facebook',
'type' => 'text',
'tab' => 'social',
),
array(
'name' => 'Note',
'id' => 'note',
'type' => 'textarea',
'tab' => 'note',
),
),
);
This will work in post if added to functions.php ... but if we try to use it in a custom post type the metabox will appear but the fields will not.
Any help would be appreciated.

SSL breaks a users ability to upload an image

I have a problem that is driving me crazy. I'm working on a business listing website in WordPress which allows business users to upload their businesses, along with a description and an image.
All was working fine in development but as soon as a SSL is installed on the site, image uploads produce an error:
An error occurred in the upload. Please try again later.
The inspector console shows:
400 error: Failed to load resource: the server responded with a status of 400 (Bad Request)
and the file cannot be uploaded.
I'm out of my depth here - any ideas please?
I think this is the relevant part of the theme library - not sure it it helps?
<?php
if ( ! search_and_go_elated_listing_plugin_installed() ) {
//exit if listing plugin is not installed
return;
}
if(!function_exists('search_and_go_elated_map_listing_type_settings')) {
function search_and_go_elated_map_listing_type_settings() {
$meta_box_listing_type = search_and_go_elated_create_meta_box(array(
'scope' => 'listing-type-item',
'title' => 'Listing Type Settings',
'name' => 'listing_type_settings_meta_box'
));
search_and_go_elated_create_meta_box_field(array(
'name' => 'eltd_listing_type_show_phone',
'type' => 'yesno',
'label' => esc_html__( 'Show Phone Field', 'search-and-go' ),
'default_value' => 'yes',
'parent' => $meta_box_listing_type
));
search_and_go_elated_create_meta_box_field(array(
'name' => 'eltd_listing_type_show_website',
'type' => 'yesno',
'label' => esc_html__( 'Show Website Field', 'search-and-go' ),
'default_value' => 'yes',
'parent' => $meta_box_listing_type
));
search_and_go_elated_create_meta_box_field(array(
'name' => 'eltd_listing_type_show_email',
'type' => 'yesno',
'label' => esc_html__( 'Show Email Field', 'search-and-go' ),
'default_value' => 'yes',
'parent' => $meta_box_listing_type
));
search_and_go_elated_create_meta_box_field(array(
'name' => 'eltd_listing_type_show_gallery',
'type' => 'yesno',
'label' => esc_html__( 'Show Gallery Images', 'search-and-go' ),
'default_value' => 'yes',
'parent' => $meta_box_listing_type
));
search_and_go_elated_create_meta_box_field(array(
'name' => 'eltd_listing_type_show_video',
'type' => 'yesno',
'label' => esc_html__( 'Show Video', 'search-and-go' ),
'default_value' => 'yes',
'parent' => $meta_box_listing_type
));
search_and_go_elated_create_meta_box_field(array(
'name' => 'eltd_listing_type_show_audio',
'type' => 'yesno',
'label' => esc_html__( 'Show Audio', 'search-and-go' ),
'default_value' => 'yes',
'parent' => $meta_box_listing_type
));
search_and_go_elated_create_meta_box_field(array(
'name' => 'eltd_listing_type_show_work_hours',
'type' => 'yesno',
'label' => esc_html__( 'Show Working Hours', 'search-and-go' ),
'default_value' => 'yes',
'parent' => $meta_box_listing_type
));
search_and_go_elated_create_meta_box_field(array(
'name' => 'eltd_listing_type_show_social_icons',
'type' => 'yesno',
'label' => esc_html__( 'Show Social Icons', 'search-and-go' ),
'default_value' => 'yes',
'parent' => $meta_box_listing_type
));
search_and_go_elated_create_meta_box_field(array(
'name' => 'eltd_listing_type_show_price',
'type' => 'yesno',
'label' => esc_html__( 'Show Price', 'search-and-go' ),
'default_value' => 'yes',
'parent' => $meta_box_listing_type
));
search_and_go_elated_create_meta_box_field(array(
'name' => 'eltd_listing_type_show_sidebar_gallery',
'type' => 'yesno',
'label' => esc_html__( 'Show Sidebar Gallery', 'search-and-go' ),
'description' => '',
'default_value' => 'yes',
'parent' => $meta_box_listing_type
));
search_and_go_elated_create_meta_box_field(array(
'name' => 'eltd_listing_type_show_booking_form',
'type' => 'yesno',
'label' => esc_html__( 'Show Booking Form', 'search-and-go' ),
'description' => esc_html__( 'Requires Elated Booking Plugin to be installed', 'search-and-go' ),
'default_value' => 'yes',
'parent' => $meta_box_listing_type
));
//init icon pack hide and show array. It will be populated dinamically from collections array
$listing_type_icon_pack_hide_array = array();
$listing_type_icon_pack_show_array = array();
//do we have some collection added in collections array?
if (is_array(search_and_go_elated_icon_collections()->iconCollections) && count(search_and_go_elated_icon_collections()->iconCollections)) {
//get collections params array. It will contain values of 'param' property for each collection
$listing_type_icon_collections_params = search_and_go_elated_icon_collections()->getIconCollectionsParams();
//foreach collection generate hide and show array
foreach (search_and_go_elated_icon_collections()->iconCollections as $dep_collection_key => $dep_collection_object) {
$listing_type_icon_pack_hide_array[$dep_collection_key] = '';
//we need to include only current collection in show string as it is the only one that needs to show
$listing_type_icon_pack_show_array[$dep_collection_key] = '#eltd_listing_type_icon_' . $dep_collection_object->param . '_container';
//for all collections param generate hide string
foreach ($listing_type_icon_collections_params as $listing_icon_collections_param) {
//we don't need to include current one, because it needs to be shown, not hidden
if ($listing_icon_collections_param !== $dep_collection_object->param) {
$listing_type_icon_pack_hide_array[$dep_collection_key] .= '#eltd_listing_type_icon_' . $listing_icon_collections_param . '_container,';
}
}
//remove remaining ',' character
$listing_type_icon_pack_hide_array[$dep_collection_key] = rtrim($listing_type_icon_pack_hide_array[$dep_collection_key], ',');
}
}
search_and_go_elated_create_meta_box_field(
array(
'parent' => $meta_box_listing_type,
'type' => 'select',
'name' => 'listing_type_icon_pack',
'default_value' => 'font_awesome',
'label' => esc_html__( 'Listing Type Icon Pack', 'search-and-go' ),
'description' => esc_html__( 'Choose icon pack for listing', 'search-and-go' ),
'options' => search_and_go_elated_icon_collections()->getIconCollections(),
'args' => array(
'dependence' => true,
'hide' => $listing_type_icon_pack_hide_array,
'show' => $listing_type_icon_pack_show_array
)
)
);
if (is_array(search_and_go_elated_icon_collections()->iconCollections) && count(search_and_go_elated_icon_collections()->iconCollections)) {
//foreach icon collection we need to generate separate container that will have dependency set
//it will have one field inside with icons dropdown
foreach (search_and_go_elated_icon_collections()->iconCollections as $collection_key => $collection_object) {
$icons_array = $collection_object->getIconsArray();
//get icon collection keys (keys from collections array, e.g 'font_awesome', 'font_elegant' etc.)
$icon_collections_keys = search_and_go_elated_icon_collections()->getIconCollectionsKeys();
//unset current one, because it doesn't have to be included in dependency that hides icon container
unset($icon_collections_keys[array_search($collection_key, $icon_collections_keys)]);
$listing_icon_hide_values = $icon_collections_keys;
$listing_icon_container = search_and_go_elated_add_admin_container(
array(
'parent' => $meta_box_listing_type,
'name' => 'listing_type_icon_' . $collection_object->param . '_container',
'hidden_property' => 'listing_type_icon_pack',
'hidden_value' => '',
'hidden_values' => $listing_icon_hide_values
)
);
search_and_go_elated_create_meta_box_field(
array(
'parent' => $listing_icon_container,
'type' => 'select',
'name' => 'listing_type_icon_' . $collection_object->param,
'default_value' => '',
'label' => esc_html__( 'Listing Type Icon', 'search-and-go' ),
'description' => esc_html__( 'Choose Listing Type Icon', 'search-and-go' ),
'options' => $icons_array,
)
);
}
}
search_and_go_elated_add_custom_fields_creator(array(
'name' => 'listing_custom_fields' ,
'label' => esc_html__( 'Custom Fields Creator', 'search-and-go' ),
'desciption' => esc_html__( 'Create listing type custom fields', 'search-and-go' ),
'parent' => $meta_box_listing_type
));
$feature_list_title = search_and_go_elated_add_admin_section_title(
array(
'parent' => $meta_box_listing_type,
'title' => esc_html__( 'Listing Type Feature List', 'search-and-go' ),
'name' => 'listing_type_feature_list_title'
)
);
search_and_go_elated_add_repeater_field(array(
'name' => 'eltd_listing_type_repeater',
'parent' => $meta_box_listing_type,
'fields' => array(
array(
'type' => 'textsimple',
'name' => 'eltd_listing_type_feature_list',
'label' => '',
'description' => '',
),
)
)
);
}
add_action('search_and_go_elated_meta_boxes_map', 'search_and_go_elated_map_listing_type_settings');
}

How to add custom fields in ACF programmatically?

I want to programmatically add a tab with repeater inside but I can't seem to find a solution, I've googled all available resources but still not working.
I already tried using acf_add_local_field_group and acf_add_local_field but still no luck.
Well I can create a tab using acf_add_local_field but when I tried to add a child which in this case a repeater OR even a text field it still doesn't work.
Here's my code to create a tab and its child but the child doesn't work.
acf_add_local_field(array(
'key' => 'field_1',
'label' => 'Sub Title',
'name' => 'sub_title',
'type' => '',
'parent' => 'field_5bd14c9349930',
'fields' => array (
array(
'key' => 'field_2',
'label' => 'This is a test',
'name' => 'my_test',
'type' => 'text',
)
)
));
You should use acf_add_local_field_group to construct the whole field group.
Here's the proper code for adding a group and a custom tab with single repeater field inside:
if( function_exists('acf_add_local_field_group') ):
acf_add_local_field_group(array (
'key' => 'group_1',
'title' => 'My Group',
'fields' => array (
array (
'key' => 'field_unique_key',
'label' => 'First Tab',
'name' => '',
'type' => 'tab',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'placement' => 'top',
'endpoint' => 0,
),
array (
'key' => 'field_unique_key',
'label' => 'Simple Repeater',
'name' => 'simple_repeater',
'type' => 'repeater',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'collapsed' => '',
'min' => 0,
'max' => 10,
'layout' => 'table',
'button_label' => 'Add row',
'sub_fields' => array ( // Here you can add as many subfields for this repeater as you want
array (
'key' => 'field_unique_key',
'label' => 'Link',
'name' => 'link',
'type' => 'link', // example link type
'instructions' => 'Link name and URL',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'return_format' => 'array',
),
),
),
),
'location' => array (
array (
array (
'param' => 'post_type',
'operator' => '==',
'value' => 'post',
),
),
),
'menu_order' => 0,
'position' => 'normal',
'style' => 'default',
'label_placement' => 'top',
'instruction_placement' => 'label',
'hide_on_screen' => '',
));
endif;

Visual Composer Nested shortcodes in a container

I just created a nested shortcode with vc_map for a wordpress website.
It works pretty well and is really simple.
My parent shortcode is "simple_table" and my chlidren shortcode are "simple_table_row".
[simple_table param="foo"]
[simple_tablerow param="another_foo"]
[simple_tablerow param="another_foo"]
[simple_tablerow param="another_foo"]
[/simple_table]
I can add my shortcode in the root of a page or in row.
However I am unable to add inside an another container like tabs, tour, accordion or Pageable Container. My nested shortcode doesn't appear in the list of elements. I already created several simples shortcodes which work properly in these specific cases.
Here are my vc_map :
vc_map( array(
"name" => "Simple_table",
"description" => "Simple_table",
"base" => "simple_table",
"class" => "simple_table",
"content_element" => true,
"is_container" => true,
'as_parent' => array('only' => 'simple_tablerow'),
"show_settings_on_create" => true,
"icon" => "simple_table_icon",
"category" => __('Content', 'js_composer'),
"js_view" => 'VcColumnView',
"params" => array(
array(
'type' => 'param_group',
'value' => '',
'param_name' => 'cols',
"heading" => "Cols",
'params' => array(
array(
'type' => 'textfield',
"holder" => "div",
'value' => '',
'heading' => 'Data',
'param_name' => 'data',
'admin_label' => true,
),
array(
'type' => 'textfield',
'value' => '',
'heading' => 'Style',
'param_name' => 'style',
),
array(
'type' => 'textfield',
'value' => '',
'heading' => 'Class',
'param_name' => 'class',
)
)
),
array(
"type" => "checkbox",
"class" => "",
"heading" => "hide_header",
"param_name" => "hide_header"
),
array(
"type" => "textfield",
"holder" => "",
"class" => "",
"heading" => "Class",
"param_name" => "class"
),
),
)
);
vc_map( array(
"name" => "Simple_tablerow",
"description" => "simple_tablerow",
"base" => "simple_tablerow",
"class" => "simple_tablerow",
"content_element" => true,
"as_child" => array('only' => 'simple_table'),
"show_settings_on_create" => true,
"icon" => "hide_header",
"category" => __('Content', 'js_composer'),
"params" => array(
array(
'type' => 'param_group',
'value' => '',
'param_name' => 'cols',
"heading" => "Cols",
'params' => array(
array(
'type' => 'textfield',
'value' => '',
'heading' => 'Data',
'param_name' => 'data',
'admin_label' => true,
),
array(
'type' => 'textfield',
'value' => '',
'heading' => 'Style',
'param_name' => 'style',
),
array(
'type' => 'textfield',
'value' => '',
'heading' => 'Class',
'param_name' => 'class',
)
),
),
array(
'type' => 'textfield',
'value' => '',
'heading' => 'Class',
'param_name' => 'class',
)
),
)
);
How can I add my nested shortcodes available in container like tabs, tour, accordion or Pageable Container ?
Note : The parameter "allowed_container_element" seems to be the cause, but how do I modify this value ?
Hopefully you found the answer to this already, since this is a bit old, but I was searching for an answer myself and this came up.
This documentation site might be of use to you https://kb.wpbakery.com/docs/developers-how-tos/nested-shortcodes-container/
If I had to guess, it seems you forgot the last bit of code at the bottom where you extend the WPBakeryShortCodesContainer
//Your "container" content element should extend WPBakeryShortCodesContainer class to inherit all required functionality
if ( class_exists( 'WPBakeryShortCodesContainer' ) ) {
class WPBakeryShortCode_Your_Gallery extends WPBakeryShortCodesContainer {
}
}
if ( class_exists( 'WPBakeryShortCode' ) ) {
class WPBakeryShortCode_Single_Img extends WPBakeryShortCode {
}
}
It's been over 3 years from original question, but i had similar problem. Removing the following line worked for me:
"is_container" => true,

Resources