Custom filters

Map List Pro has a number of filters that let you change more advanced functions of the map and list. The code snippets listed below should be added to your theme’s function.php.

Change the order of the map, list, messages, paging, and search boxes

This should return an array of strings. The order of the array sets the order that parts will display in. Options to return are: map, search, message, list, and paging.

Change what shows in the infobox

This should return an array of strings. The order of the array sets the order that parts will display in. Options to return are (all optional):

  • “title” : The location title
  • “thumbnail” : The featured image thumbnail
  • “description” : The short description (as shows in the list)
  • “simpledescription” : The short description without the address
  • “categories” : Any categories specified for this item
  • “address” : The location address field

 Change the order of the content on the location detail page

This should return an array of strings. The order of the array sets the order that parts will display in. Options to return are:

  • “map” : The map
  • “title” : The locatioon title
  • “content” : The long description
  • “shortdescription” : The short description (as shows in the list)
  • “custom” : Any custom fields you add via the detail hook
  • “address” : The location address field
  • “directions” : Directions – only shows if enabled in settings;

Change the description text

This filter allows you to add custom text to the description text for each location. The filter function gets the page content, the location fields, and the full location object.

Add extra fields to the location editor

You can add fields to the location editor that are saved with the location. For a full list of the field types you can use take a look at this page. Note: Map List Pro may not support all of the field types listed.

Change the description for each location

This filter gets the current description html, all fields for the current location, and the location post object.

Any processing on locations before they’re loaded

If you need to change anything on locations that aren’t already handled by other filters then this filter gives you access to the full map object and parameters.

 

SmartRedFox has written 30 articles