Since version 4.9 visual composer added shortcode lazy loading. To use VC shortcodes on AJAX content use this function before printing the content WPBMap::addAllMappedShortcodes();
. So below code may help you,
function get_page_content(){
$id = $_REQUEST['id'];
$page_data = get_page($id);
WPBMap::addAllMappedShortcodes();
echo apply_filters('the_content', $page_data->post_content);
wp_die();
}
add_action( 'wp_ajax_nopriv_get_page_content', 'get_page_content' );
add_action( 'wp_ajax_get_page_content', 'get_page_content' );
Related Posts:
- Ajax, filters and shortcodes
- apply_filters(‘the_content’, $content) vs do_shortcode($content)
- How to get shortcode’s input values inside a filter?
- Filter specific shortcode output?
- Insert Custom HTML After Shortcode
- Is there a way to add another row to the tinyMCE kitchen sink toggle?
- add_filter and changing output captions of image gallery
- AJAX filter posts on click based on category
- How can I send data to admin-ajax via JS Fetch?
- How to add attribute to output with wp_video_shortcode add_filter
- Search content for shortcodes and get parameters
- Change default settings used by gallery shortcode
- Format content value from DB outside of WordPress filters
- Use content custom filter for all shortcodes
- Multiple Ajax Data Action
- How to link current user to their author page through shortcodes
- filter title from shortcode
- how to remove filter from wordpress shortcode output
- Error when overriding only some audio shortcode HTML output
- How to use shortcode attribute in separate function
- Are there actions or filters I can use for Ajax calls?
- Shortcodes — Using add_action, add_filter in the shortcode
- Does a plugin with a AJAX button filter exist? [closed]
- How to pass variables to custom filter from multiple functions
- How to filter backend post list showing only posts having a shortcode
- wp_mail works with add_action(‘save_post’, …) but not an ajax action
- How can I return shortcode output to the top of the content?
- Is it possible to bind a function to a filter hook via Ajax?
- the_excerpt filter doesn’t work as expected
- How To Override A WooCommerce AJAX Function
- run shortcode in excerpt of single custom post type
- Filter everything from content except output of a shortcode
- Something is filtering my shortcodes… Can’t figure out what
- How to use do_shortcode_tag to modify the output of a shortcode?
- Shortcodes within the sidebar text/html widget: How to preserve the raw HTML output of the shortcode?
- How to change dynamically page title according to variable data?
- How can I filter tag_description()?
- WordPress removing slashes from shortcode output
- How to remove shortcode(s) from WYSIWYG Page editor for Non Admins
- Shortcode / plugin with custom (flexible) output
- Filter Shortcodes when using get_page
- Parse a shortcode differently based on on what it’s nested in
- Need to return shortcode text instead of the output
- add_filter to the_content after apply_filters
- Best practice: Custom Post Type / Filter / Load more
- post_orderby filter breaks function
- the_content getting current page content instead specified ID
- Ajax filter – show all results that contain at least one filter
- Override wordpress audio playlist
- AJAX Post Filter
- How to wrap pattern-matches from the_content in [wiki]-shortcode tags
- Add Index to Item in WordPress Gallery
- create a shortcode with acf including a filter
- How to take shortcode and content separately from a page?
- Display post after choice two taxonomy terms
- Ajax Filtering Pagination
- Auto-generated excerpt with shortcode and read more button/text link
- Change add_filter based on Ajax
- Filter posts by categories ajax is showing all the posts
- Code restricted to dashboard, running unexpectedly in the frontend (pre_get_post and admin-ajax.php)
- shortcode function outputs multiple anchor tags
- apply_filters to $GLOBALS
- Change shortcode output (filter?)
- Is it possible to include the add_filter() function within a shortcode function
- Activate short codes for all post queries?
- Problem with shortcodes in external file
- Loading a sidebar on an Ajax call
- How can I display wp_link_pages before a shortcode, if it is used, or display after content?
- How could I create real-time filtering in this case?
- Load More : Admin Ajax 400 Bad request, returning 0
- AAPF Filter group is not in widget section
- Pagination don’t work with active filters
- How to set a filter search for categories of blog posts in wordpress
- Sql query does not work well
- How to Edit Ecommerce filters URL, h1, h2 , Title
- How do I add tags to entire comments, not just their text
- How can i filter wordpress users by custom feild?
- Same URL for portfolio and for a page creates 404 error. Is there any filter that i can use for a child page?
- Why does admin_body_class not work?
- Replace Data In Post & Update Meta Field Post Is Saved
- Filter Media by attached page or blog post in Library
- Disable Remember Me in Login Form
- How to stop DOMDocument destroying embeds?
- ‘manage_users_custom_column’ is a filter, but ‘manage_posts_custom_column’ is an action. Why?
- Is it better to use a constant or apply_filter?
- comment_notification_text filter not working
- Line Breaks are stripped off when direction property is found
- How to optionally append components to the output of a gutenberg block?
- How do I add a line break to a string that is output by PHP?
- Ajax Post Filter | Split Taxonomy Into minPrice & maxPrice
- How do I make these combination select filters work when only one dropdown is set? They work in WordPress 5.8.2 but don’t in 5.8.3
- Scanning for custom embed and prefetching
- Dashboard filter based on custom fields URL response code
- The gettext hook doesnt work on text with links
- How to Create custom block for displaying information in content section which act like shortcode
- Problem width wp_insert_post_data and Gutenberg block editor
- How to apply filter on get_the_post_thumbnail()
- Filter widget_posts_args not working
- How to filter the source URL of all images on every page
- Loop order issue with Ajax filter