File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -45,22 +45,22 @@ public function render_page() {
45
45
}
46
46
47
47
// Set up fields
48
- $ token = $ _REQUEST ['oauth_token ' ];
48
+ $ token_key = $ _REQUEST ['oauth_token ' ];
49
49
$ scope = '* ' ;
50
50
if ( ! empty ( $ _REQUEST ['wp_scope ' ] ) ) {
51
51
$ scope = $ _REQUEST ['wp_scope ' ];
52
52
}
53
53
54
54
$ authenticator = new WP_JSON_Authentication_OAuth1 ();
55
55
$ errors = array ();
56
- $ token = $ authenticator ->get_request_token ( $ _REQUEST [ ' oauth_token ' ] );
57
- if ( is_wp_error ( $ token ) ) {
58
- $ this ->display_error ( $ token );
56
+ $ this -> token = $ authenticator ->get_request_token ( $ token_key );
57
+ if ( is_wp_error ( $ this -> token ) ) {
58
+ $ this ->display_error ( $ this -> token );
59
59
exit ;
60
60
}
61
61
62
62
// Fetch consumer
63
- $ consumer = get_post ( $ token ['consumer ' ] );
63
+ $ this -> consumer = $ consumer = get_post ( $ this -> token ['consumer ' ] );
64
64
65
65
if ( ! empty ( $ _POST ['wp-submit ' ] ) ) {
66
66
check_admin_referer ( 'json_oauth1_authorize ' );
@@ -86,7 +86,8 @@ public function render_page() {
86
86
* nonce field.
87
87
*/
88
88
public function page_fields () {
89
- echo '<input type="hidden" name="consumer" value=" ' . absint ( $ consumer ->ID ) . '" /> ' ;
89
+ echo '<input type="hidden" name="consumer" value=" ' . absint ( $ this ->consumer ->ID ) . '" /> ' ;
90
+ echo '<input type="hidden" name="oauth_token" value=" ' . esc_attr ( $ this ->token ['key ' ] ) . '" /> ' ;
90
91
wp_nonce_field ( 'json_oauth1_authorize ' );
91
92
}
92
93
You can’t perform that action at this time.
0 commit comments