• I was looking for something lightweight, simple, and, with an intuitive real-time interface for my client. This met the requirements.

    Here are some sugestions for improvement, though.

    1. Adding a template with a picture and button. Now, the only templates with pictures are the ones with sign-up forms.
    2. Adding an option to set a lifetime of a cookie when the modal window is closed, including a session cookie for example.
    3. Adding an option to open a link assigned to a button in a new window.
    4. Don’t load styles when no window is active. It can be simply done by checking whether any post of hollerbox type is published.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter fkoomek

    (@fkoomek)

    And I forgot…
    5. That little ring when notification box is closed could stay there across whole site then. This was the behavior I was expected.

    Thread Starter fkoomek

    (@fkoomek)

    Here’s my working code for unloading styles and js:

    <?php
    /*unload hollerbox styles and js when none modal published*/
    add_action('init','init_now');
    function init_now() {
    
    function wp_67472456()
    {
    	
    	//check if published posts are < 1
    if (wp_count_posts( 'hollerbox' )->publish < 1){
    	//check if it's not an iframe to prevent disabling in builder when none pop up is published
    	if( isset($_SERVER['HTTP_SEC_FETCH_DEST']) && $_SERVER['HTTP_SEC_FETCH_DEST'] !== 'iframe' )
    		{
    			//disable styles
    	wp_dequeue_style('hollerbox-popups');
    	wp_dequeue_script('hollerbox-popups');	
    	}
    }
    }
    add_action('wp_enqueue_scripts', 'wp_67472456', 11);
    add_action('wp_print_styles', 'wp_67472456');
    Thread Starter fkoomek

    (@fkoomek)

    Sorry, there was curly bracket missing at the end:

    /*Disable Hollerbox popups styles when none modal published*/
    add_action('init','init_now');
    function init_now() {
    
    function wp_67472456()
    {
    	
    	//check if published posts are < 1
    if (wp_count_posts( 'hollerbox' )->publish < 1){
    	//check if it's not an iframe to prevent disabling in builder when none pop up is published
    	if( isset($_SERVER['HTTP_SEC_FETCH_DEST']) && $_SERVER['HTTP_SEC_FETCH_DEST'] !== 'iframe' )
    		{
    			//disable styles
    	wp_dequeue_style('hollerbox-popups');
    	wp_dequeue_script('hollerbox-popups');	
    	}
    }
    }
    add_action('wp_enqueue_scripts', 'wp_67472456', 11);
    add_action('wp_print_styles', 'wp_67472456');
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘I like it.’ is closed to new replies.