问题
A similar question has been asked here, without any viable responses: Visual Composer custom markup for custom shortcode (vc_map)
and here: Visual Composer custom shortcode template - custom_markup display user input
I am trying to create custom markup within the WPBakery interface.
I can add custom markup no problem by doing:
$markup = 'test';
vc_map( array(
"name" => __("MyShortcode"),
"base" => "myshortcode",
"category" => __('Content'),
"custom_markup" => $markup, // @TODO how do we access shortcode's attributes here to display in bakery grid
"params" => $params
) );
This will output "test" in the WPBakery grid which is good, but how do I access vc_map() internal values to display?
For instance I have "post types" as a field for this shortcode. If someone selects "page" post type for example, I would like to display those posts within the WPBakery grid. What I cannot figure out is how to get the values that the user selected to display.
Any help would be greatly appreciated. I've searched endlessly on this one.
来源:https://stackoverflow.com/questions/59933956/how-do-i-access-vc-map-internal-values-to-create-custom-markup-for-wpbakery-in