Reply To: Does not pick up all images and VC code as excerpt

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Does not pick up all images and VC code as excerpt Reply To: Does not pick up all images and VC code as excerpt

#7288
Ernest Marcinko
Ernest Marcinko
Keymaster

Hi!

I’ve tried to access the site, but I’m getting redirected to this URL: http://www.kingjamesbibleonline.org/http:/www.petvetoasis.com/blocked/

Altough I know what is causing the problem. Someome reported an issue with VC shortcodes a while back, and after hours I was able to determine that Visual Composer is no longer loading it’s shortcodes in ajax context. This is a huge problem, as any ajax powered plugin will return the visual composer shortcodes instead of the executed formatted content.

I contacted their support about this problem, but they weren’t too helpful with me. I even bough a separate hosting, and made a plugin to demonstrate the problem + I gave them full access to the environment. After one week they responded how should I solve it, but I had to ask 5 times to tell me if this is intentional or a bug, so I can make the critical changes in Ajax Search Pro.

Anyways, to apply a temporary fix, add this code to your active themes function.php file:

function asp_force_load_vc_shortcodes( $post_ID ) {
  // VC 4.6+ fix: Shortcodes are not loaded in ajax responses
  if ( method_exists("WPBMap", "addAllMappedShortcodes") )
    WPBMap::addAllMappedShortcodes();
}
add_action( 'asp_before_search', 'asp_force_load_vc_shortcodes' );

I’m hoping this will fix both of the issues. Let me know if this works!

The next release of the plugin is coming soon, I already implemented this fix directly based on their support response. I sure hope they are not planning to change this again.

Best,
Ernest Marcinko

If you like my products, don't forget to rate them on codecanyon :)