Mashup template using filter in Functions

Home Forums MapPress Support Mashup template using filter in Functions

Tagged: , ,

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #18438
    AboveMedia
    Participant

    Hello,

    I’m using the following code on my child theme’s functions.php file:

    function customPoiMessage($props, $postid, $poi) {
    $props[[‘message’]] = “Hello from post ” . $postid;
    return $props;
    }
    add_filter(‘mappress_poi_props’, ‘customPoiMessage’, 10, 3);

    and then the following in my mashup-item.php file:


    <div class=”mapp-title”>{{{poi.props.message}}}</div>

    However, the output is empty:

    <div class=”mapp-item” data-mapp-action=”open” data-mapp-poi=”4″><div class=”mapp-title”></div></div>

    Has this been deprecated/updated, or am I doing something wrong?

    Thanks!

    #18439
    Chris
    Keymaster

    Hi,

    Is this how the code looks?

    $props[['message']]

    If so, it should have only single brackets:

    $props['message']
    #18440
    AboveMedia
    Participant

    That’s exactly right. Thanks! Amazing plugin BTW.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.