Below, you’ll find a detailed guide on how to add the Content Visibility for Divi Builder Shortcode to your WordPress website, including its parameters, examples, and PHP function code. Additionally, we’ll assist you with common issues that might cause the Content Visibility for Divi Builder Plugin shortcode not to show or not to work correctly.
Before starting, here is an overview of the Content Visibility for Divi Builder Plugin and the shortcodes it provides:
"Content Visibility for Divi Builder is a handy WordPress plugin that allows you to control the visibility of your Divi Builder content, enabling a personalized user experience."
- [medb_execute]
Content Visibility for Divi Builder [medb_execute] Shortcode
The content-visibility-for-divi-builder plugin’s shortcode is designed to execute specific functions. The medb_execute shortcode triggers a sequence of actions. It applies filters to the plugin key, and executes a callback function associated with the wrapped element. This function uses various parameters including attributes, content, function name, and parent details. This shortcode provides flexibility and control over the Divi Builder content visibility, enhancing the user experience.
Shortcode: [medb_execute]
Examples and Usage
Basic example – A shortcode that executes the ‘medb_execute’ function with minimal parameters
[medb_execute id="1" /]
Advanced examples
Here, the shortcode is used to execute the ‘medb_execute’ function with multiple parameters. It includes the ID, content, function name, parent address, global parent, global parent type, parent type, and theme builder area. This provides more control over the output of the shortcode.
[medb_execute id="1" content="Hello World" function_name="my_function" parent_address="http://example.com" global_parent="parent1" global_parent_type="type1" parent_type="type2" theme_builder_area="header" /]
In this next example, the shortcode is used to execute the ‘medb_execute’ function with a different set of parameters. The parameters include the ID, content, function name, and theme builder area. This example shows how the shortcode can be customized to suit different needs.
[medb_execute id="2" content="Welcome to my site" function_name="welcome_message" theme_builder_area="footer" /]
PHP Function Code
In case you have difficulties debugging what causing issues with [medb_execute]
shortcode, check below the related PHP functions code.
Shortcode line:
add_shortcode( $this->tag, array( $this, 'medb_execute' ) );
Shortcode PHP function:
function medb_execute( $atts, $content, $function_name, $parent_address = '', $global_parent = '', $global_parent_type = '', $parent_type = '', $theme_builder_area = '' ) {
return apply_filters( $this->plugin_key . '_shortcode_' . $this->tag, call_user_func( array( $this->wrapped_element, $this->wrapped_element_shortcode_callback ), $atts, $content, $function_name, $parent_address, $global_parent, $global_parent_type, $parent_type, $theme_builder_area ), $atts, $content, $function_name, $this->wrapped_element, $this->wrapped_element_shortcode_callback );
}
Code file location:
content-visibility-for-divi-builder/content-visibility-for-divi-builder/content-visibility-for-divi-builder.php
Conclusion
Now that you’ve learned how to embed the Content Visibility for Divi Builder Plugin shortcode, understood the parameters, and seen code examples, it’s easy to use and debug any issue that might cause it to ‘not work’. If you still have difficulties with it, don’t hesitate to leave a comment below.
Leave a Reply