Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #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.

    #994858

    Hey 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,
    Victoria

    #994861

    I 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.

    #994878

    We 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]

    #994882

    Hi 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

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