Skip to content

Commit aea43cd

Browse files
committed
Merge pull request #80 from thiago-negri/feature/filter-wp-api-v2
Add filter to signal error for WP-API v2
2 parents 4ca54cf + 533f786 commit aea43cd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/class-wp-json-authentication.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,13 @@ public function __construct() {
2626
}
2727

2828
add_filter( 'json_check_authentication', array( $this, 'authenticate' ), 0 );
29+
add_filter( 'rest_authentication_errors', array( $this, 'get_authentication_errors' ), 0 );
2930
}
3031

3132
abstract public function authenticate( $user );
3233

34+
abstract public function get_authentication_errors( $value );
35+
3336
public function get_consumer( $key ) {
3437
$this->should_attempt = false;
3538

0 commit comments

Comments
 (0)