Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Jeff Starr

    (@specialk)

    Thanks for reporting. I will look into it and try to resolve any issue. In the meantime please let me know if any further developments, etc. Thank you.

    Thread Starter marknopfler

    (@marknopfler)

    Jeff, any news?

    Plugin Author Jeff Starr

    (@specialk)

    It’s in the works, no promises on a solution however, as CF7 is not my plugin. If at all possible should be available before the next WP update (to version 6.2).

    Plugin Author Jeff Starr

    (@specialk)

    Looking into this, the CF7 REST addon sort of works. Visitors can still send messages normally, but the resulting success or error messages are not displayed on the page. Presumably this is because there is some other REST-requiring behavior for the success/error messages.

    As a note to self: the CF7 REST addon is very simple:

    function disable_wp_rest_api_post_var($var) { 
    	
    	return '_wpcf7'; 
    }
    add_filter('disable_wp_rest_api_post_var', 'disable_wp_rest_api_post_var');

    It hooks into the following code in Contact Form 7:

    function disable_wp_rest_api_allow_access() {
    	
    	$post_var = apply_filters('disable_wp_rest_api_post_var', false);
    	
    	if (!empty($post_var)) {
    		
    		if (isset($_POST[$post_var]) && !empty($_POST[$post_var])) return true;
    		
    	}
    	
    	return false;
    	
    }

    And the above does work fine. Users can send messages. The problem is that somewhere CF7 also needs REST access to display success and error messages while users interact with the form. I spent some time digging around CF7 and it seems like any solution will need to happen on the CF7 side of things. Just not something possible from within the Disable WP REST API plugin.

    I will keep my eyes on it, and likewise if anyone has related/useful infos, please feel free to comment on this thread, or even open a new one.

    Thanks again @marknopfler, for reporting and feedback.

    Plugin Author Jeff Starr

    (@specialk)

    One more update on this. Figured it out and wrote up the solution (for Disable REST API version 2.5 or better). Please test and report any further issues. Should work perfectly though.

    • This reply was modified 1 year, 9 months ago by Jeff Starr.
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Contact Form error 401’ is closed to new replies.