-
AuthorPosts
-
August 8, 2018 at 8:15 am #994701
Hi,
i am using the new DSGVO / GDPR features of enfold.
However i hav other plugins installed that use google maps too, but (obviously) are not affected by enfold’s googleMap setting (on/off).So i will write a shortcode like [googleMapsEnfold] that will hide content if deactivated and show content if activated. This helps us using enfolds settings with other plugins too.
Possible usage:
[googleMapsEnfold] [pluginShortcode] [/googleMapsEnfold]What i need is the piece of code to get that status from enfold theme in PHP – you must have a helper function for this i suppose.
August 8, 2018 at 11:19 am #994858Hey rup,
No, we don’t we do not have control over other elements. You might want to hire a freelancer to do write the custom functionality to do it for you.
Best regards,
VictoriaAugust 8, 2018 at 11:22 am #994861I know that you dont have control over other elements. Please read my post again carefully.
Thats why we will write the custom functionality.We only need the name of the function you already must have to check if the enfold flag “Google Map” is set or not programmatically.
August 8, 2018 at 11:53 am #994878We already solved it.
Think about adding a shortcode like this into enfold – then users can use enfolds tracking cookie to disable other plugins. No need for an extra piece of software. A few lines and it’s done.function googleMapsEnabled( $atts , $content = null ) { if(isset($_COOKIE["aviaPrivacyGoogleMapsDisabled"])) { return '<div id="avia-messagebox-" class="avia_message_box avia-color-orange avia-size-large avia-icon_select-yes avia-border- avia-builder-el-3 el_before_av_textblock avia-builder-el-first"><div class="avia_message_box_content"><span class="avia_message_box_icon" aria-hidden="true" data-av_icon="" data-av_iconfont="entypo-fontello"></span><p>'.__("This service uses Google Maps and has been disabled by the user due to selected privacy option.","avia_framework").'</p> </div></div>'; } else { return do_shortcode($content); } } add_shortcode( 'googleMapsEnabled','googleMapsEnabled');
Usage:
[googleMapsEnabled] [plugin_shortcode] [/googleMapsEnabled]
August 8, 2018 at 11:58 am #994882Hi rup,
Glad you got it working for you and thank you for sharing! :)
If you need further assistance please let us know.
Best regards,
Victoria -
AuthorPosts
- You must be logged in to reply to this topic.