Filter added successfully but callback never get called

I’m trying to authenticate a rest-api request with access token. I’m using v3.1.9 of WP OAuth Server plugin available on Github for OAuth 2 authentication. The requests are successfully authenticated with this plugin when testing on localhost. But, when trying to authenticate rest requests for a remote site it fails and wp_get_current_user returns false.

When I tried to dig dipper by debugging I found that the filter callback for authentication is never called. The callback for filter added here never get called and hence user is not authenticated for rest request. The filter is applied for a request by _wp_get_current_user function at line #2603 in users.php of WordPress core. I tried to add another filter for debugging but that’s also not get called.

add_filter( ‘determine_current_user’, function() {
error_log(‘****** determining ******’);
}, 5 );

I can’t find the underlying problem which is preventing this filter to being applied.

Read more here:: Filter added successfully but callback never get called

Leave a Reply

Your email address will not be published. Required fields are marked *