profile.php
4.25 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<?php if ( ! defined( 'ABSPATH' ) ) {
exit;
}
global $post_id;
$user_fields = array();
foreach ( UM()->builtin()->all_user_fields() as $key => $arr ) {
$user_fields[ $key ] = isset( $arr['title'] ) ? $arr['title'] : '';
}
$_um_tagline_fields = get_post_meta( $post_id, '_um_tagline_fields', true );
$_um_reveal_fields = get_post_meta( $post_id, '_um_reveal_fields', true );
$fields = array(
array(
'id' => '_um_profile_photo',
'type' => 'checkbox',
'label' => __( 'Enable Profile Photo', 'ultimate-member' ),
'value' => (bool) get_post_meta( $post_id, '_um_profile_photo', true ),
),
array(
'id' => '_um_cover_photos',
'type' => 'checkbox',
'label' => __( 'Enable Cover Photo', 'ultimate-member' ),
'tooltip' => __( 'If turned on, the users cover photo will appear in the directory', 'ultimate-member' ),
'value' => (bool) get_post_meta( $post_id, '_um_cover_photos', true ),
),
array(
'id' => '_um_show_name',
'type' => 'checkbox',
'label' => __( 'Show display name', 'ultimate-member' ),
'value' => (bool) get_post_meta( $post_id, '_um_show_name', true ),
),
array(
'id' => '_um_show_tagline',
'type' => 'checkbox',
'label' => __( 'Show tagline below profile name', 'ultimate-member' ),
'value' => (bool) get_post_meta( $post_id, '_um_show_tagline', true ),
),
array(
'id' => '_um_tagline_fields',
'type' => 'multi_selects',
'label' => __( 'Choose field(s) to display in tagline', 'ultimate-member' ),
'value' => $_um_tagline_fields,
'conditional' => array( '_um_show_tagline', '=', 1 ),
'add_text' => __( 'Add New Custom Field', 'ultimate-member' ),
'options' => $user_fields,
'show_default_number' => 1,
'sorting' => true,
),
array(
'id' => '_um_show_userinfo',
'type' => 'checkbox',
'label' => __( 'Show extra user information below tagline?', 'ultimate-member' ),
'value' => (bool) get_post_meta( $post_id, '_um_show_userinfo', true ),
),
array(
'id' => '_um_reveal_fields',
'type' => 'multi_selects',
'label' => __( 'Choose field(s) to display in extra user information section', 'ultimate-member' ),
'value' => $_um_reveal_fields,
'add_text' => __( 'Add New Custom Field', 'ultimate-member' ),
'conditional' => array( '_um_show_userinfo', '=', 1 ),
'options' => $user_fields,
'show_default_number' => 1,
'sorting' => true,
),
array(
'id' => '_um_show_social',
'type' => 'checkbox',
'label' => __( 'Show social connect icons in extra user information section', 'ultimate-member' ),
'value' => (bool) get_post_meta( $post_id, '_um_show_social', true ),
'conditional' => array( '_um_show_userinfo', '=', 1 ),
),
array(
'id' => '_um_userinfo_animate',
'type' => 'checkbox',
'label' => __( 'Hide extra user information to the reveal section', 'ultimate-member' ),
'tooltip' => __( 'If not checked always shown', 'ultimate-member' ),
'value' => (bool) get_post_meta( $post_id, '_um_userinfo_animate', true ),
'conditional' => array( '_um_show_userinfo', '=', 1 ),
),
);
/**
* UM hook
*
* @type filter
* @title um_admin_extend_directory_options_general
* @description Extend Directory options fields
* @input_vars
* [{"var":"$fields","type":"array","desc":"Directory options fields"}]
* @change_log
* ["Since: 2.0"]
* @usage add_filter( 'um_admin_directory_sort_users_select', 'function_name', 10, 1 );
* @example
* <?php
* add_filter( 'um_admin_directory_sort_users_select', 'my_directory_sort_users_select', 10, 1 );
* function my_directory_sort_users_select( $sort_types ) {
* // your code here
* return $sort_types;
* }
* ?>
*/
$fields = apply_filters( 'um_admin_extend_directory_options_profile', $fields ); ?>
<div class="um-admin-metabox">
<?php
UM()->admin_forms(
array(
'class' => 'um-member-directory-profile um-half-column',
'prefix_id' => 'um_metadata',
'fields' => $fields,
)
)->render_form();
?>
<div class="um-admin-clear"></div>
</div>