-
Notifications
You must be signed in to change notification settings - Fork 0
/
author-meta.php
47 lines (29 loc) · 1.06 KB
/
author-meta.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
<?php
function author_meta_tags() {
$final = array();
$meta_prefix = meta_prefix();
$final[] = $meta_prefix."hashtag_1";
$final[] = $meta_prefix."hashtag_2";
$final[] = $meta_prefix."hashtag_3";
$final[] = $meta_prefix."website";
$final[] = $meta_prefix."twitter";
$final[] = $meta_prefix."facebook";
$final[] = $meta_prefix."instagram";
}
add_action( 'show_user_profile', 'my_show_extra_profile_fields' );
add_action( 'edit_user_profile', 'my_show_extra_profile_fields' );
function my_show_extra_profile_fields( $user ) { ?>
<h3>Extra profile information</h3>
<table class="form-table">
<?php foreach(author_meta_tags() as $meta) { ?>
<tr>
<th><label for="twitter">Twitter</label></th>
<td>
<input type="text" name="twitter" id="twitter" value="<?php echo esc_attr( get_the_author_meta( 'twitter', $user->ID ) ); ?>" class="regular-text" /><br />
<span class="description">Please enter your Twitter username.</span>
</td>
</tr>
<?php } ?>
</table>
<?php }
?>