• Resolved bilievesser

    (@bilievesser)


    I have used bypasses in the functions.php file before, but this time I am having trouble with a page that has a Contact form 7 form on it.
    The page itself is bypasses, but the form is never submitted. Upon loading the page, this is showing in console:
    Response { type: "basic", url: "https://redacted.com/wp-json/contact-form-7/v1/contact-forms/12345/feedback/schema", redirected: false, status: 401, ok: false, statusText: "Unauthorized", headers: Headers, body: ReadableStream, bodyUsed: false }

    I have tried both of these to no help

    function my_forcelogin_bypass( $bypass, $visited_url ) {
      // Allow dynamic URL
    	  if ( is_page('/wp-json/contact-form-7/v1/contact-forms/12345/feedback/schema/') ) {
        $bypass = true;
      }
      $allowed = array(
    	home_url( '/wp-json/contact-form-7/v1/contact-forms/12345/feedback/schema/' ),
        );
      if ( ! $bypass ) {
        $bypass = in_array( $visited_url, $allowed );
      }
    
      return $bypass;
    }
    add_filter( 'v_forcelogin_bypass', 'my_forcelogin_bypass', 10, 2 );

    Any ideas?

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