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 to add a custom CSS class to core blocks in Gutenberg editor?
- Filter translations (gettext strings) on specific admin pages
- Filter hook before create order WooCommerce
- add_filter for specific pages
- wp_title() empty on a static front page
- Customize WooCommerce Error Message
- How to add Shortcode (font awesome) in widget title?
- Dump contents of a variable inside a filter/hook callback that runs during save post
- Right way to add HTML bloginfo name using a filter
- Allow users to exclude categories? (WP 3.1.2)
- De-bloating the page classes
- Redirect to checkout woocommerce failed
- wp_insert_post_data filter hook identify current action
- Upload file if contains certain name
- Filters/Bulk Actions return wrong URL in admin dashboard
- Add filter to get_posts
- How to redirect non-logged in users to login with post_password_required()
- How to add nonce tag to inline script for CSP
- Filter content for get_the_content()
- How to strip out javascript in wp_posts `post_content`
- What is the action or filter for adding information under the Permalink in Edit Post/Page?
- add after content don’t work
- Adding a filter to related posts not working
- need correction with a snippet in functions.php [closed]
- Why does wp_die() not work when inside a namespace?
- Apply pre_get_posts filter in a certain moment (just for a particular block of posts)
- How to Change the WordPress Locale with the ‘locale’ Filter?
- functions.php filters not applied in AJAX call
- Wrapping Featured Image on Add/Edit Page in div?
- Clean/filter HTML inserted to post content by XML RPC
- How to change response of admin-ajax request?
- Filter a custom post type by custom field in admin