• Resolved meggsico

    (@meggsico)


    Hello Joe

    I hope you are fine. I would like to ask you a question.

    Is it possible to make makers invisible with a shortcode?

    I have different user roles. Some users shouldn’t see the photos. Up to now, i have generated 2 waymark-maps one with and the other one without photos.

    Thx for your answer

    Meggsico

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Joe

    (@morehawes)

    Hi @meggsico,

    Yes this is possible. If you add the following code to your theme functions.php file then it will only display Markers with the Type “Photo” to administrators (for example).

    function waymark_head_css() {
      //Ensure Waymark loaded
      if(! class_exists('Waymark_CSS')) {
        return;
      }
      
      //Get logged-in user
      global $current_user;
    
      //If not administrator
      if(! in_array('administrator', $current_user->roles)) {
        //Hide Markers of Type "Photo"
        Waymark_CSS::add_chunk('.waymark-map .waymark-marker-photo { display: none !important; }');
      }
    }
    add_action('wp_head', 'waymark_head_css');

    Hopefully you can adapt this to suit your needs. Please note, this only hides the Markers from the Map; if you are using the Overlay Filter then the Type will still be listed there. Let me know if this is important to you.

    Cheers,

    Joe

    Thread Starter meggsico

    (@meggsico)

    Hi Joe

    Thank you very much for your post. It is so that i’m using the overlay filter.

    To show content for a user role i’m using a plugin. It would be cool if I could make some markers invisible with a shortcode, like the following example code

    [content_control roles=gold,silber,bronze]
    [Waymark map_id="9178" show_gallery="0" show_marker_(photo)="0"]
    ..
    ..
    
    [/content_control]
    
    

    With a code like this i need only one map in waymark. Until now i always have to create two same maps. Once with photos and once without.

    Cheers,
    Meggs

    • This reply was modified 4 years, 9 months ago by meggsico.
    Plugin Author Joe

    (@morehawes)

    show_marker_(photo)=”0″

    Nice suggestion! I have added this to the features list, please feel free to add additional comments or upvote other features you would like.

    Cheers,

    Joe

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Make Marker invisible’ is closed to new replies.