• Resolved decoupe2psd

    (@decoupe2psd)


    Hello, I’m using this plugin for several years now and I’ve encountered an issue today ; but I can’t get it around. I have a website with a waiting page, within there’s a contact form 7 form. The plugin redirect every non logged user to this page, so far, so good. Except that the contact form is not working, I’m pretty sure it’s because Restricted Access prevent any access to others pages, in this case, an ajax request witch send the form. Any work around ?

    Thank you ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • Tung Du

    (@dinhtungdu)

    Hi @decoupe2psd, to whitelist the CF7 request, you can use restricted_site_access_is_restricted filter to control the restriction based on $wp object, for example:

    
    add_filter( 'restricted_site_access_is_restricted', function( $is_restricted, $wp ) {
    	if( strpos( $wp->request, 'wp-json/contact-form-7/v1/contact-forms' ) !== false ) {
    		return false;
    	}
    	return $is_restricted;
    }, 10, 2 );
    
    Thread Starter decoupe2psd

    (@decoupe2psd)

    Works like a charm ! Thank you !

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Contact form 7 not working’ is closed to new replies.