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
- Disable emojicons introduced with WP 4.2
- Why is javascript allowed in my post content?
- Adding a filter to qTranslate to change display of language chooser
- How can I display image metadata?
- Apply the_title filter to post titles AND backend auto social-sharing plugin, but not nav menu
- How to hook some Unicode texts into calendar widget safely?
- How to add attributes to tag when template cannot be directly modified
- Edit pagination text in the get_the_posts_pagination function
- How does WordPress call functions attached to a certain action hook before calling functions attached to other hooks
- When adding buttons to the tinyMCE editor, how do I make them wrap to the next line and/or display in the “Kitchen Sink” area?
- How to change the order of HTML output of a core block?
- How to add ‘total’ value to custom column title on the posts list page
- Is it possible to use multiple spaces in title?
- Filter out comments with certain meta key/s in the admin backend
- HTML and custom field variable, inside variable
- do_shortcode via ajax
- WordPress custom admin notice still displays after wp_insert_post_data validation
- Upload restrictions – upload_mimes – filter: Adding multiple MIMEs for a single extension and adding multiple extensions for a single MIME type?
- Pass debug_backtrace() in WordPress filter
- How do I add tags to entire comments, not just their text
- Modify WordPress Page Title ()
- How to add lazy field in content endpoint using Gutenberg blocks
- how to use apply filter for Class?
- Set Microsoft Word links to open in new window/tab
- WordPress get_avatar filter to match logins
- Load next post by ID on a single page
- Updating User Profile on Registration
- remove_filter excerpt_more from a plugin class
- Query Multiple Filters, one with Meta
- How to remove a filter that is an object method?