12
12
* Bootstrap actions for the profile screen.
13
13
*/
14
14
function bootstrap () {
15
- add_action ( 'personal_options ' , __NAMESPACE__ . '\\render_profile_section ' , 50 );
15
+ add_action ( 'show_user_profile ' , __NAMESPACE__ . '\\render_profile_section ' );
16
+ add_action ( 'edit_user_profile ' , __NAMESPACE__ . '\\render_profile_section ' );
16
17
add_action ( 'all_admin_notices ' , __NAMESPACE__ . '\\output_profile_messages ' );
17
18
add_action ( 'personal_options_update ' , __NAMESPACE__ . '\\handle_revocation ' , 10 , 1 );
18
19
add_action ( 'edit_user_profile_update ' , __NAMESPACE__ . '\\handle_revocation ' , 10 , 1 );
@@ -26,34 +27,26 @@ function bootstrap() {
26
27
function render_profile_section ( WP_User $ user ) {
27
28
$ tokens = Access_Token::get_for_user ( $ user );
28
29
?>
29
- <table class="form-table">
30
- <tbody>
30
+ <h2><?php _e ( 'Authorized Applications ' , 'oauth2 ' ) ?> </h2>
31
+ <?php if ( ! empty ( $ tokens ) ): ?>
32
+ <table class="widefat">
33
+ <thead>
31
34
<tr>
32
- <th scope="row"><?php _e ( 'Authorized Applications ' , 'oauth2 ' ) ?> </th>
33
- <td>
34
- <?php if ( ! empty ( $ tokens ) ): ?>
35
- <table class="widefat">
36
- <thead>
37
- <tr>
38
- <th style="padding-left:10px;"><?php esc_html_e ( 'Application Name ' , 'oauth2 ' ); ?> </th>
39
- <th></th>
40
- </tr>
41
- </thead>
42
- <tbody>
43
- <?php
44
- foreach ( $ tokens as $ token ) {
45
- render_token_row ( $ token );
46
- }
47
- ?>
48
- </tbody>
49
- </table>
50
- <?php else : ?>
51
- <p class="description"><?php esc_html_e ( 'No applications authorized. ' , 'oauth2 ' ) ?> </p>
52
- <?php endif ?>
53
- </td>
35
+ <th style="padding-left:10px;"><?php esc_html_e ( 'Application Name ' , 'oauth2 ' ); ?> </th>
36
+ <th></th>
54
37
</tr>
38
+ </thead>
39
+ <tbody>
40
+ <?php
41
+ foreach ( $ tokens as $ token ) {
42
+ render_token_row ( $ token );
43
+ }
44
+ ?>
55
45
</tbody>
56
46
</table>
47
+ <?php else : ?>
48
+ <p class="description"><?php esc_html_e ( 'No applications authorized. ' , 'oauth2 ' ) ?> </p>
49
+ <?php endif ?>
57
50
<?php
58
51
}
59
52
0 commit comments