-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsingle-json_consumer.php
58 lines (50 loc) · 1.98 KB
/
single-json_consumer.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php get_header(); the_post(); global $post; ?>
<h1><a href="<?php echo home_url( '/apps/' ) ?>">Apps</a> → <?php the_title() ?></h1>
<div class="content">
<form method="post">
<p>
<label>Application Name</label>
<input name="application_name" type="text" value="<?php echo esc_attr( $post->post_title ) ?>" />
<span class="description">This is shown to users during authorization and in their profile.</span>
</p>
<p>
<label>Description</label>
<textarea name="application_description" rows="8"><?php echo esc_textarea( $post->post_content ) ?></textarea>
</p>
<p>
<label>Callback URL</label>
<input name="application_callback_url" type="text" value="<?php echo esc_attr( get_post_meta( get_the_id(), 'callback', true ) ) ?>" />
<span class="description">Your application's callback URL. The callback passed with the request token must match the scheme, host, port, and path of this URL.</span>
</p>
<p>
<button type="submit" name="ba-action" value="edit-application">Save Application</button>
<button type="submit" name="ba-action" value="delete-application">Delete Application</button>
</p>
<input type="hidden" name="application_id" value="<?php echo $post->ID ?>" />
<?php wp_nonce_field( 'ba-edit-application' ) ?>
</form>
</div>
<div class="oauth-credentials">
<h2>OAuth Credentials</h2>
<table>
<tr>
<td>
Client Key
</td>
<td>
<code><?php echo esc_html( get_post_meta( get_the_id(), 'key', true ) ) ?></code>
</td>
</tr>
<tr>
<td>
Client Secret
</td>
<td>
<code><?php echo esc_html( get_post_meta( get_the_id(), 'secret', true ) ) ?></code><br />
<a class="button" href="<?php echo wp_nonce_url( add_query_arg( array( 'ba-action' => 'regenerate-app-secret', 'consumer' => get_the_id() ) ), 'regenerate-secret' ) ?>">Regenerate Secret</a><br />
<span class="description">Warning: Regenerating the secret will invalidate all connections.</span>
</td>
</tr>
</table>
</div>
<?php get_footer() ?>