Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Jeremy Groot
/
stellervista-Intranet
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
ba9eb32d
authored
2023-03-02 11:47:45 -0500
by
Jeff Balicki
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
eee
Signed-off-by: Jeff <jeff@gotenzing.com>
1 parent
586624d5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
121 deletions
wp-content/themes/understrap-child/inc/shortcodes.php
wp-content/themes/understrap-child/inc/shortcodes.php
View file @
ba9eb32
...
...
@@ -7,124 +7,3 @@ function firstname(){
return
"<span class='first-name'>Hi "
.
$user
->
first_name
.
"</span>"
;
}
/**
EXTRA ULTIMATE MEMBER
*/
//add_action('um_after_account_general', 'showExtraFields', 100);
function
showExtraFields
()
{
//these are the meta fields created in registration field
$custom_fields
=
[
"phone_number"
=>
"Phone Number (XXX-XXX-XXXX)"
,
"mobile_number"
=>
"Mobile Number (XXX-XXX-XXXX)"
,
];
foreach
(
$custom_fields
as
$key
=>
$value
)
{
$fields
[
$key
]
=
array
(
'title'
=>
$value
,
'metakey'
=>
$key
,
'type'
=>
'select'
,
'label'
=>
$value
,
);
apply_filters
(
'um_account_secure_fields'
,
$fields
,
'wall_privacy'
);
$field_value
=
get_user_meta
(
um_user
(
'ID'
),
$key
,
true
)
?
:
''
;
$html
=
'<div class="um-field um-field-'
.
$key
.
'" data-key="'
.
$key
.
'">
<div class="um-field-label">
<label for="'
.
$key
.
'">'
.
$value
.
'</label>
<div class="um-clear"></div>
</div>
<div class="um-field-area">
<input class="um-form-field valid "
type="text" name="'
.
$key
.
'"
id="'
.
$key
.
'" value="'
.
$field_value
.
'"
placeholder=""
data-validate="" data-key="'
.
$key
.
'">
</div>
</div>'
;
echo
$html
;
}
}
//action to update values of custom field
add_action
(
'um_account_pre_update_profile'
,
'my_account_pre_update_profile'
,
10
,
2
);
function
my_account_pre_update_profile
(
$changes
,
$user_id
)
{
update_user_meta
(
$user_id
,
'phone_number'
,
$_POST
[
'phone_number'
]
);
update_user_meta
(
$user_id
,
'mobile_number'
,
$_POST
[
'mobile_number'
]
);
}
/**
CODE FOR VIEWING "Extra profile information" AREA IN YOUR USERS BACK-END, MATCH IT WITH YOUR CUSTOM NAMES
*/
function
mysite_custom_define
()
{
$custom_meta_fields
=
array
();
$custom_meta_fields
[
'phone_number'
]
=
'phone_number'
;
$custom_meta_fields
[
'mobile_number'
]
=
'mobile_number Address'
;
return
$custom_meta_fields
;
}
function
mysite_columns
(
$defaults
)
{
$meta_number
=
0
;
$custom_meta_fields
=
mysite_custom_define
();
foreach
(
$custom_meta_fields
as
$meta_field_name
=>
$meta_disp_name
)
{
$meta_number
++
;
$defaults
[(
'mysite-usercolumn-'
.
$meta_number
.
''
)]
=
__
(
$meta_disp_name
,
'user-column'
);
}
return
$defaults
;
}
function
mysite_custom_columns
(
$value
,
$column_name
,
$id
)
{
$meta_number
=
0
;
$custom_meta_fields
=
mysite_custom_define
();
foreach
(
$custom_meta_fields
as
$meta_field_name
=>
$meta_disp_name
)
{
$meta_number
++
;
if
(
$column_name
==
(
'mysite-usercolumn-'
.
$meta_number
.
''
)
)
{
return
get_the_author_meta
(
$meta_field_name
,
$id
);
}
}
}
function
mysite_show_extra_profile_fields
(
$user
)
{
print
(
'
Extra profile information
'
);
print
(
''
);
$meta_number
=
0
;
$custom_meta_fields
=
mysite_custom_define
();
foreach
(
$custom_meta_fields
as
$meta_field_name
=>
$meta_disp_name
)
{
$meta_number
++
;
print
(
''
);
print
(
''
);
print
(
''
);
print
(
''
);
}
print
(
'
'
.
$meta_disp_name
.
' '
);
print
(
'
'
);
print
(
''
);
print
(
'
'
);
}
function
mysite_save_extra_profile_fields
(
$user_id
)
{
if
(
!
current_user_can
(
'edit_user'
,
$user_id
))
return
false
;
$meta_number
=
0
;
$custom_meta_fields
=
mysite_custom_define
();
foreach
(
$custom_meta_fields
as
$meta_field_name
=>
$meta_disp_name
)
{
$meta_number
++
;
update_usermeta
(
$user_id
,
$meta_field_name
,
$_POST
[
$meta_field_name
]
);
}
}
// add_action('show_user_profile', 'mysite_show_extra_profile_fields');
// add_action('edit_user_profile', 'mysite_show_extra_profile_fields');
// add_action('personal_options_update', 'mysite_save_extra_profile_fields');
// add_action('edit_user_profile_update', 'mysite_save_extra_profile_fields');
// add_action('manage_users_custom_column', 'mysite_custom_columns', 15, 3);
//
add_filter
(
'manage_users_columns'
,
'mysite_columns'
,
15
,
1
);
\ No newline at end of file
...
...
Please
register
or
sign in
to post a comment