Forum Replies Created
-
AuthorPosts
-
EddyPiV
ParticipantSorry, I was fighting with the code. But I hope you can work on it, right?
EddyPiV
ParticipantHi Long,
Getting back on this issue.
My installation is a multisite. The code to copy custom_avatar to the standard wordpress profile picture works nicely for the subsite running MetaBox, but 2 other sites using the same (child) theme are facing critical errors.
When taking out the code, they're back to normal.This is the code I have:
`
/* MetaBox - replace WP gravatar with custom gravatar */
add_filter( 'get_avatar' , 'my_custom_avatar' , 1 , 5 );
function my_custom_avatar( $avatar, $id_or_email, $size, $default, $alt ) {
$user = false;
if ( is_numeric( $id_or_email ) ) {
$id = (int) $id_or_email;
$user = get_user_by( 'id' , $id );
} elseif ( is_object( $id_or_email ) ) {
if ( ! empty( $id_or_email->user_id ) ) {
$id = (int) $id_or_email->user_id;
$user = get_user_by( 'id' , $id );
}
} else {
$user = get_user_by( 'email', $id_or_email );
}if ( $user && is_object( $user ) ) {
$value = rwmb_meta( 'custom_avatar', array( 'object_type' => 'user' ), $user->data->ID );
$value = reset( $value );
if ( $value ) {
$avatar = "<img alt='" . $alt . "' height='" . $size . "' width='" . $size . "' />";
}
}
return $avatar;
}
`
Is something extra needed to handle this multisite installation?EddyPiV
ParticipantThanks a lot, Long.
Perhaps it makes sense to change the article https://metabox.io/create-custom-avatar/ accordingly, as I would expect not many webmasters would like to give their members access to the media library.
Anyway, it works very nicely now. Thanks again.
April 11, 2021 at 5:09 PM in reply to: ✅Tag Archive - my view gets ignored when rendering "Only the post content area" #27151EddyPiV
ParticipantThanks Long, I understand and managed to get it working.
EddyPiV
ParticipantHi Long,
Yes, I forgot the array.
But that makes the code for the functions.php more complicated for me, as I struggle to combine it with the array for the object type 'user'. (Critical errors...)
Can you help please?
Thanks.April 11, 2021 at 4:12 AM in reply to: ✅Tag Archive - my view gets ignored when rendering "Only the post content area" #27131EddyPiV
ParticipantHi Long,
I haven't seen a response from you.
I wish it would work as you say, but it doesn't look like it.
To demonstrate my case:
- This setting (https://share.getcloudapp.com/nOuok1RO) leads to this view (https://share.getcloudapp.com/nOuok1Xg)- This setting (https://share.getcloudapp.com/mXupybxr) leads to this view (https://share.getcloudapp.com/wbuw7vXG)
So for some reason it looks like replacing the post content area gets ignored in my case.
Where am I going wrong?
March 23, 2021 at 8:04 PM in reply to: ✅Tag Archive - my view gets ignored when rendering "Only the post content area" #26619EddyPiV
ParticipantWhat I'm trying to say is that for "Render for: Only the post content area" and "Position: Replaces the post content" my commands in the Views are ignored, as the default WP archive layout gets applied.
It does work for the other rendering options, but that's not what I want.
EddyPiV
ParticipantAh, good to know. Yes, it's working nicely. Thanks!
March 11, 2021 at 4:32 AM in reply to: ✅First Name and Last Name are not getting copied to user data #24834EddyPiV
ParticipantLong, thanks for the suggestion. I am using Forminator Pro and there is a registration form in it, I will be using that instead.
I will continue using the User Profile plugin for changing the user profile.
Can you please close this thread?
March 10, 2021 at 9:03 PM in reply to: ✅First Name and Last Name are not getting copied to user data #24825EddyPiV
ParticipantLong, I don't think checking if the email exists is good enough. One needs to know if the user has access to that emailaccount. That is also the requirement for GDPR. Double opt-in is a must.
I hope Metabox has a solution for it, otherwise I have to look for an alternative for this part of the process.
March 10, 2021 at 1:33 PM in reply to: ✅First Name and Last Name are not getting copied to user data #24810EddyPiV
ParticipantI don't see how the documentation you refer to addresses my question on activating the double optin or the feature of WordPress to validate the emailaddress.
At the moment the registraton leads to direct adding of the new user in WordPress.
March 10, 2021 at 12:10 AM in reply to: ✅First Name and Last Name are not getting copied to user data #24800EddyPiV
ParticipantWell, that was pretty obvious. Thanks Long.
Remains my question on the double opt-in, to ensure the e-mailaddress exists and belongs to this user.
I can't find anything on that subject, neither in the documentation nor on this forum.March 8, 2021 at 11:11 PM in reply to: ✅First Name and Last Name are not getting copied to user data #24782EddyPiV
ParticipantIn addition to this question: How do I enforce a double opt-in, like it is standard in WordPress?
November 30, 2020 at 2:27 PM in reply to: ✅Archive for 1 custom taxonomy results in 'page not found' #23111EddyPiV
ParticipantThanks Long, that solved it.
November 13, 2020 at 4:45 PM in reply to: ✅Is there a way to edit user meta data through frontend submission? #22840EddyPiV
ParticipantOK, thanks
-
AuthorPosts