Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Saurabh – WPMU DEV Support

    (@wpmudev-support7)

    Hello @mako2,

    Initially, the close button would not trigger the Trigger once per session function. The link text “NO, gracas! No estoy interesado.” below the pop up would do that. If you want the close button to also have that function, could you please add the following mu-plugin to your site which should make that work too.

    <?php
    add_action( 'plugins_loaded', 'wpmudev_hustle_trigger_session_close_popup_func', 100 );
    function wpmudev_hustle_trigger_session_close_popup_func() {
    	if( defined('HUSTLE_SUI_VERSION') && class_exists( 'Hustle_Module_Collection' ) ){
    		add_action( 'wp_footer', 'wpmudev_hustle_trigger_session_close_popup', 21 );
    		function wpmudev_hustle_trigger_session_close_popup(){
    			$custom_script = '<script>
    				(function($){
    					$(function(){
    						if( window.HUI ){
    							let _triggered = 0,
    									_popups = $(".hustle-popup");
    							_popups.on("hustle:module:closed", function(){
    							if( ! _triggered ){
    								$(".hustle-nsa-link").trigger("click");
    									_triggered = 1;
    								}
    							});
    						}
    					});
    				})(window.jQuery)
    			</script>';
    			echo $custom_script;
    		}
    	}
    }

    Check out the following link to know more about what a mu-plugin is:

    Must Use Plugins

    Here are the steps to install an mu-plugin:
    https://premium.wpmudev.org/docs/getting-started/download-wpmu-dev-plugins-themes/

    Do let me know if it works for you.

    Thank you,
    Prathamesh Palve

    Plugin Support Dimitris – WPMU DEV Support

    (@wpmudev-support6)

    Hello @mako2

    It’s been a while since we’ve heard back from you, so I’m marking this topic as resolved. Feel free to post back any updates and we can re-open it and continue troubleshooting. ??

    Thank you,
    Dimitris

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Triger once per session not working’ is closed to new replies.