CHECKING STATUS
I AM LISTENING TO
|

WP REST API rendered output & Visual Composer

5. February 2018
.SHARE

Table of Contents

Visual Composer shortcodes are normally not converted within the WordPress REST API rendered output.

This can be accomplished by calling WPBMap::addAllMappedShortcodes();

add_action( 'rest_api_init', function ()
{
   register_rest_field(
          'page',
          'content',
          array(
                 'get_callback'    => 'convert_do_shortcodes',
                 'update_callback' => null,
                 'schema'          => null,
          )
       );
});

function convert_do_shortcodes( $object, $field_name, $request )
{
   WPBMap::addAllMappedShortcodes(); // This does all the work

   global $post;
   $post = get_post ($object['id']);
   $output['rendered'] = apply_filters( 'the_content', $post->post_content );

   return $output;
}
Let’s Talk!

Looking for a reliable partner to bring your project to the next level? Whether it’s development, design, security, or ongoing support—I’d love to chat and see how I can help.

Get in touch,
and let’s create something amazing together!

RELATED POSTS

Let’s cut through the noise: FAQ schema isn’t dead. But if you’re still using it the same way you did in 2022, you’re kinda missing the entire point of why it matters now. Google dropped a bombshell back in August 2023 when they restricted FAQ rich results to only government and health websites. So yeah, […]

So you’re paying for Adobe Creative Cloud just to use a few web fonts? Yeah, I’ve been there. Adobe Fonts (formerly Typekit) is great and all, but let’s be real: not everyone wants to shell out for a subscription just to load some pretty typography on their website. Plus, there’s that whole GDPR thing where […]

This is my own task / project / workflow solution fully integrated into WordPress, which I began developing in 2025. After the recent cloud outages—and following a significant investment in the Asana ecosystem—I decided to build a robust, self-hosted WordPress solution featuring an almost complete Asana Sync API integration. I don’t have plans to make […]

Alexander

I am a full-stack developer. My expertise include:

  • Server, Network and Hosting Environments
  • Data Modeling / Import / Export
  • Business Logic
  • API Layer / Action layer / MVC
  • User Interfaces
  • User Experience
  • Understand what the customer and the business needs


I have a deep passion for programming, design, and server architecture—each of these fuels my creativity, and I wouldn’t feel complete without them.

With a broad range of interests, I’m always exploring new technologies and expanding my knowledge wherever needed. The tech world evolves rapidly, and I love staying ahead by embracing the latest innovations.

Beyond technology, I value peace and surround myself with like-minded individuals.

I firmly believe in the principle: Help others, and help will find its way back to you when you need it.