wpsl_strip_content_shortcode

  1. Description
  2. Usage
  3. Changelog
  4. Source File
  5. Related

Description

When the post content data is included in the returned data, the shortcodes in the content are always removed. With this filter you can change that, so the shortcode output will show up in the returned data.

The post content is included when you select one or more locations in Location(s) of the post content on Store Locator > Settings > User Experience, or when you use the wpsl_include_post_content filter.

The filter applies to the post content in the search results data, and to the post content in the marker pop-up of the [wpsl_map] shortcode, which is used on the store pages. That pop-up shows the post content when The landing page marker pop-up is selected in the same setting.

Usage

You can prevent the shortcodes from being removed from the post content by using the code below.

add_filter( 'wpsl_strip_content_shortcode', '__return_false' );

If Load locations on page load is on, the locations shown on page load can come from a cache. After you add the filter, go to Store Locator > Settings > Tools and click Clear cache next to Autoload cache.

Changelog

VersionDescription
3.0Moved to includes/frontend/store/class-data.php. The filter now also applies to the post content in the [wpsl_map] marker pop-up. The post content is included through the new Location(s) of the post content setting.
2.2.18Introduced.

Source File

This filter is located in /includes/frontend/store/class-data.php.

Placement

The code needs to be placed in the functions.php file inside your active theme folder.