wpsl_include_post_content

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

Description

This filter allows you to include the post content of each location in the search results data, without showing it anywhere.

To show the post content, you don’t need this filter. Go to Store Locator > Settings > User Experience and select where it should appear in Location(s) of the post content, for example in the search results, the “more info” section or the marker pop-up. Any selection there also adds the post content to the data.

Use the filter when the setting is empty and you still need the content in the data, for example for your own template code or script. The content is then available under the description key.

The default is false.

Usage

add_filter( 'wpsl_include_post_content', '__return_true' );

The content is run through the the_content filters. Shortcodes are removed from it first. To keep them, use the wpsl_strip_content_shortcode filter.

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. Otherwise the description key only shows up after a search.

Changelog

VersionDescription
3.0Moved to includes/frontend/store/class-data.php. The post content is now also included when any location is selected in the Location(s) of the post content setting, which replaces the old "More info" condition. The filter is only needed to include the content without showing it.
2.0Introduced.

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.