Skip to content

Commit 1a910ae

Browse files
committed
Move filter registration out of constructor
1 parent fbdf01c commit 1a910ae

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

lib/class-wp-json-authentication.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ public function __construct() {
2424
_doing_it_wrong( 'WP_JSON_Authentication::__construct', __( 'The type of authentication must be set' ), 'WPAPI-0.9' );
2525
return;
2626
}
27-
28-
add_filter( 'json_check_authentication', array( $this, 'authenticate' ), 0 );
29-
add_filter( 'rest_authentication_errors', array( $this, 'get_authentication_errors' ), 0 );
3027
}
3128

3229
abstract public function authenticate( $user );

oauth-server.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ function json_oauth_load() {
6060

6161
$wp_json_authentication_oauth1 = new WP_JSON_Authentication_OAuth1();
6262
add_filter( 'determine_current_user', array( $wp_json_authentication_oauth1, 'authenticate' ) );
63-
add_filter( 'json_authentication_errors', array( $wp_json_authentication_oauth1, 'get_authentication_errors' ) );
63+
add_filter( 'rest_authentication_errors', array( $wp_json_authentication_oauth1, 'get_authentication_errors' ) );
6464
}
6565
add_action( 'init', 'json_oauth_load' );
6666

0 commit comments

Comments
 (0)