Skip to content

Commit a8952cc

Browse files
committed
Rename main class
1 parent 8391515 commit a8952cc

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

admin.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ function json_oauth_admin_handle_edit_submit( $consumer ) {
131131
}
132132

133133
if ( empty( $consumer ) ) {
134-
$authenticator = new WP_JSON_Authentication_OAuth1();
134+
$authenticator = new WP_REST_OAuth1();
135135

136136
// Create the consumer
137137
$data = array(
@@ -281,7 +281,7 @@ function json_oauth_profile_section( $user ) {
281281
return $row['user'] === $user->ID;
282282
} );
283283

284-
$authenticator = new WP_JSON_Authentication_OAuth1();
284+
$authenticator = new WP_REST_OAuth1();
285285

286286
?>
287287
<table class="form-table">
@@ -340,7 +340,7 @@ function json_oauth_profile_save( $user_id ) {
340340

341341
$key = wp_unslash( $_POST['oauth_revoke'] );
342342

343-
$authenticator = new WP_JSON_Authentication_OAuth1();
343+
$authenticator = new WP_REST_OAuth1();
344344

345345
$result = $authenticator->revoke_access_token( $key );
346346
if ( is_wp_error( $result ) ) {

lib/class-wp-rest-oauth1-cli.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class WP_REST_OAuth1_CLI extends WP_CLI_Command {
1212
* : Consumer description
1313
*/
1414
public function add( $_, $args ) {
15-
$authenticator = new WP_JSON_Authentication_OAuth1();
15+
$authenticator = new WP_REST_OAuth1();
1616
$consumer = $authenticator->add_consumer( $args );
1717
WP_CLI::line( sprintf( 'ID: %d', $consumer->ID ) );
1818
WP_CLI::line( sprintf( 'Key: %s', $consumer->key ) );

lib/class-wp-rest-oauth1-ui.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function render_page() {
6868
$scope = wp_unslash( $_REQUEST['wp_scope'] );
6969
}
7070

71-
$authenticator = new WP_JSON_Authentication_OAuth1();
71+
$authenticator = new WP_REST_OAuth1();
7272
$errors = array();
7373
$this->token = $authenticator->get_request_token( $token_key );
7474
if ( is_wp_error( $this->token ) ) {

lib/class-wp-json-authentication-oauth1.php renamed to lib/class-wp-rest-oauth1.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* @subpackage JSON API
77
*/
88

9-
class WP_JSON_Authentication_OAuth1 {
9+
class WP_REST_OAuth1 {
1010
const CONSUMER_KEY_LENGTH = 12;
1111
const CONSUMER_SECRET_LENGTH = 48;
1212
const TOKEN_KEY_LENGTH = 24;

oauth-server.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Version 0.1
66
*/
77

8-
include_once( dirname( __FILE__ ) . '/lib/class-wp-json-authentication-oauth1.php' );
8+
include_once( dirname( __FILE__ ) . '/lib/class-wp-rest-oauth1.php' );
99
include_once( dirname( __FILE__ ) . '/lib/class-wp-rest-oauth1-ui.php' );
1010

1111
include_once( dirname( __FILE__ ) . '/admin.php' );
@@ -58,7 +58,7 @@ function rest_oauth1_setup_authentication() {
5858
function rest_oauth1_load() {
5959
global $wp_json_authentication_oauth1;
6060

61-
$wp_json_authentication_oauth1 = new WP_JSON_Authentication_OAuth1();
61+
$wp_json_authentication_oauth1 = new WP_REST_OAuth1();
6262
add_filter( 'determine_current_user', array( $wp_json_authentication_oauth1, 'authenticate' ) );
6363
add_filter( 'rest_authentication_errors', array( $wp_json_authentication_oauth1, 'get_authentication_errors' ) );
6464
}
@@ -92,7 +92,7 @@ function rest_oauth1_loaded() {
9292
if ( empty( $GLOBALS['wp']->query_vars['rest_oauth1'] ) )
9393
return;
9494

95-
$authenticator = new WP_JSON_Authentication_OAuth1();
95+
$authenticator = new WP_REST_OAuth1();
9696
$response = $authenticator->dispatch( $GLOBALS['wp']->query_vars['rest_oauth1'] );
9797

9898
if ( is_wp_error( $response ) ) {

0 commit comments

Comments
 (0)