• Resolved sfordev

    (@sfordev)


    MapPress shortcodes seem to have stopped rendering on single Listing pages. A MapPress shortcode will render properly in a new Gutenberg-based WP page, or on a listing location parent page. A blank Listing with only a MapPress shortcode, does not render the map.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author WPSight

    (@wpsight)

    Hello @sfordev.

    Can you please provide more details on how to include the shortcode and which shortcode you are using exactly?

    It’s best to provide some screenshots so that I can understand the issue.

    Please do not assume that I know all the plugins and how to use them. The more detailed your information is, the better I can reproduce the issue and fix it if necessary (and, if there is one).

    Thread Starter sfordev

    (@sfordev)

    This is the implementation, on a new Listing within WPCasa, with no other content.

    This is what renders on the front-end:

    When the same shortcode is used in a new WP page, the map renders correctly:

    Plugin Author WPSight

    (@wpsight)

    Thank you @sfordev for the details.

    I could reproduce this and have to write, this is not an issue.

    With WordPress security rules in mind, we needed to sanitze the output of the listing content in order to pass plugin verification and be listed in the WordPress plugin directory again.

    This sanitization required declaring the allowed HTML tags for the content. MapPress uses its own html tag <mappress-map></mappress-map> which is of course not in the list of allowed html tags. For this reason, the HTML code of the map fails the sanitization and is removed.

    But there is a solution for you: you can expand the allowed HTML tags with the WordPress filter wpsight_allowed_html_tags. Feel free to add the HTML tags you need to show the MapPress map again.

    Thread Starter sfordev

    (@sfordev)

    Thank you foe the explanation!

    I have tried the below line of code in theme functions.php, but it does not appear to be working:

    add_filter( 'wpsight_allowed_html_tags', 'mappress-map' );

    Is there anything incorrect with the formatting, or are there other arguments missing? I see the function in the plugin functions, but it is unclear what is incorrect with the add_filter.

    Plugin Author WPSight

    (@wpsight)

    The second argument of the add_filter() is a callback. There you have to manipulate and return the data. This post can help you to understand how to use filter with WordPress.

    Please understand that due to time constraints I cannot help write the code. If you need help adding the filter, someone else in the community or a friend may be able to help you.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Maps seem to be broke on single listing pages’ is closed to new replies.