The woocommerce api takes oauth1.0 for HTTP requests and basic HTTP authentication for HTTPS requests. My query is simple. How to simply remove this authentication? I did some digging and found there is a class in woocommerce plugin with a constructor as
public function __construct() {
// To disable authentication, hook into this filter at a later priority and return a valid WP_User
add_filter( 'woocommerce_api_check_authentication', array( $this, 'authenticate' ), 0 );
}
My job is to simply remove the authentication part. Here it is saying to hook this filter at a later priority. How to do so and how to return a valid WP_User?
Create your own plugin and place the following code:
This will bypass woocommerce api authentication. Use it with your own risk.
(You can add it in theme’s
functions.php
instead of own plugin. But not Tested.)