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 ) {
314314 return new static ( $ post );
315315 }
316316
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-
344317 /**
345318 * Create a new client.
346319 *
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ public function handle_authorisation() {
3939 $ scope = isset ( $ _GET ['scope ' ] ) ? wp_unslash ( $ _GET ['scope ' ] ) : null ;
4040 $ state = isset ( $ _GET ['state ' ] ) ? wp_unslash ( $ _GET ['state ' ] ) : null ;
4141
42- $ client = Client::get_by_client_id ( $ client_id );
42+ $ client = Client::get_by_id ( $ client_id );
4343 if ( empty ( $ client ) ) {
4444 return new WP_Error (
4545 'oauth2.types.authorization_code.handle_authorisation.invalid_client_id ' ,
You can’t perform that action at this time.
0 commit comments