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
cbeff607
authored
2024-01-10 16:46:51 -0500
by
Jeff Balicki
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
updated_profile
Signed-off-by: Jeff <jeff@gotenzing.com>
1 parent
7d2ad53e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
8 deletions
wp-content/themes/understrap-child/functions.php
wp-content/themes/understrap-child/functions.php
View file @
cbeff60
...
...
@@ -243,6 +243,20 @@ return $data;
}
add_action
(
'init'
,
'wpa_342456'
);
function
wpa_342456
()
{
// if query var is not present just return
if
(
isset
(
$_REQUEST
[
'my_listener'
]
)
||
'set_update_profile'
==
$_REQUEST
[
'my_listener'
]
){
$users
=
get_users
(
array
(
'fields'
=>
array
(
'ID'
)
)
);
foreach
(
$users
as
$user
){
update_user_meta
(
$user
->
ID
,
'updated_profile'
,
1
);
}
}
else
{
return
;
}
}
add_action
(
'init'
,
'wpa_34245'
);
...
...
@@ -267,6 +281,7 @@ add_action( 'profile_update', function ( $user_id, $old_user_data ) {
update_office_email
(
$user_id
);
update_branch_fax
(
$user_id
);
error_log
(
'profile update '
.
$user_id
);
update_user_meta
(
$user_id
,
'updated_profile'
,
1
);
},
10
,
2
);
...
...
@@ -301,14 +316,15 @@ add_action( 'profile_update', function ( $user_id, $old_user_data ) {
// Add your custom function to the wpo365_user_created hook
add_action
(
'wpo365_user_created'
,
'custom_redirect_after_user_created'
,
10
,
2
);
function
custom_redirect_after_user_created
(
$user_id
,
$provider
)
{
error_log
(
'registration_redirect'
);
// Redirect the user after user creation based on your requirements
wp_redirect
(
'/account/profile/'
);
exit
();
function
custom_redirects
()
{
$user
=
wp_get_current_user
();
$updated_profile
=
get_user_meta
(
$user
->
ID
,
'updated_profile'
,
true
);
if
(
!
$updated_profile
){
wp_redirect
(
home_url
(
'/account/profile/'
)
);
die
;
}
}
add_action
(
'template_redirect'
,
'custom_redirects'
);
\ No newline at end of file
...
...
Please
register
or
sign in
to post a comment