File tree Expand file tree Collapse file tree 2 files changed +1
-28
lines changed Expand file tree Collapse file tree 2 files changed +1
-28
lines changed Original file line number Diff line number Diff line change @@ -314,33 +314,6 @@ public static function get_by_post_id( $id ) {
314
314
return new static ( $ post );
315
315
}
316
316
317
- /**
318
- * Get a client by Client ID.
319
- *
320
- * @param int $id Client ID of the app.
321
- * @return static|null Client instance on success, null if invalid/not found.
322
- */
323
- public static function get_by_client_id ( $ id ) {
324
- $ args = array (
325
- 'meta_query ' => array (
326
- array (
327
- 'key ' => '_oauth2_client_id ' ,
328
- 'value ' => $ id ,
329
- 'compare ' => '= ' ,
330
- )
331
- ),
332
- 'post_type ' => 'oauth2_client ' ,
333
- 'post_status ' => 'any '
334
- );
335
-
336
- $ client_ids = get_posts ( $ args );
337
- if ( count ( $ client_ids ) !== 1 ) {
338
- return null ;
339
- }
340
-
341
- return new static ( $ client_ids [0 ] );
342
- }
343
-
344
317
/**
345
318
* Create a new client.
346
319
*
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ public function handle_authorisation() {
39
39
$ scope = isset ( $ _GET ['scope ' ] ) ? wp_unslash ( $ _GET ['scope ' ] ) : null ;
40
40
$ state = isset ( $ _GET ['state ' ] ) ? wp_unslash ( $ _GET ['state ' ] ) : null ;
41
41
42
- $ client = Client::get_by_client_id ( $ client_id );
42
+ $ client = Client::get_by_id ( $ client_id );
43
43
if ( empty ( $ client ) ) {
44
44
return new WP_Error (
45
45
'oauth2.types.authorization_code.handle_authorisation.invalid_client_id ' ,
You can’t perform that action at this time.
0 commit comments