Support » Plugin: Simple Newsletter Plugin - Noptin » Bypass Hide from Existing Subscribers

  • Resolved bling007

    (@bling007)


    Hi,

    I would like to use the Global setting option: Hide forms from all existing subscribers. However, I have deployed a simple Shortcode form for my footer which I wish to remain persistent.

    Can you please provide a code-snippet to bypass the option for that particular form?

    Regards;

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Brian Mutende

    (@picocodes)

    add_filter( ‘noptin_can_show_form’, function( $can_show, $form ) {

    // Replace 10 with the actual form ID.
    if ( 10 == $this->id ) {
    return true;
    }

    return $can_show;
    }, 10, 2 );

    Thread Starter bling007

    (@bling007)

    Thank you. Doesn’t work.. have you tested it?

    Thread Starter bling007

    (@bling007)

    add_filter( ‘noptin_can_show_form’, function( $can_show, $form ) {
    // Replace 10 with the actual form ID.
    if ( 2245974 == $this->id ) {
    return false;
    }
    return $can_show;
    },10,2 );

    Thread Starter bling007

    (@bling007)

    add_filter( ‘noptin_can_show_form’, function( $can_show, $form ) {
    // Replace 10 with the actual form ID.
    if ( 2245974 == $this->id ) {
    return true;
    }
    return $can_show;
    },10,2 );

    It doesn’t work.

    Plugin Author Brian Mutende

    (@picocodes)

    Sorry, I wrote this code at night and missed changing $this with $form. Use the below code instead.

    add_filter( 'noptin_can_show_form', function( $can_show, $form ) {
    
    	// Replace 10 with the actual form ID.
    	if ( 10 == $form->id ) {
    		return true;
    	}
    
    	return $can_show;
    }, 10, 2 );
    Thread Starter bling007

    (@bling007)

    Thanks, I understand how foggy the mind is at night. Support is excellent, I am considering opting for premium add-ons.

    Plugin Author Brian Mutende

    (@picocodes)

    That’s good to hear. Did the above snippet work for you or is there something I missed?

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