theotherdon
Forum Replies Created
-
so… here’s what I have discovered:
All of the members that have become unable to edit their profile on their UM profile page had the WP role of “Subscriber,” as well as a UM role.
If I change the WP role to “Contributor” or higher, they can edit their own profile. It doesn’t matter which UM role.
This is a change in how the UM profile pages work. I am okay with making all of my members contributors—it’s a company-internal site with restricted access. This may not work for everybody.
On their profile page.
That would have been good too! Before I saw your suggestion, i figured out a solution (probably not as efficient, but this site will always have a membership of <50 users). Using what you helped me with to build the dropdown, I wrote a new function:
function get_supervisor_login($sup_name) { $args = array( 'role' => 'um_supervisor', 'orderby' => 'user_nicename', 'order' => 'ASC' ); $users = get_users( $args ); foreach( $users as $user ) { if($user->display_name == $sup_name){ $login_name = $user->user_login; } } return $login_name; }This gets me the login (which was one of the pieces of data I needed anyway, and from that I can use get_user_by() to get the rest.
Thanks for your continued help!
–don
Well… carp!
I guess I’ll have to figure out some way to store the user ID or email.
Another week, another challenge!
So, in my customized show_meta function, I was able to use:
$items[] = apply_filters( 'um_show_meta_item_html', '<p class="' . $key . '">' . $value . '</p>', $key );instead of the original spans & bullets. This works just as I want, except…
In my custom profile form, I have added a field called “Supervisor. This field is a drop-down whose options are populated by a callback script that lists every user who has the UM role of “supervisor.” (This is the first thing you helped me with, and it works fine.
So, if the user whose profile I am displaying has a supervisor (most of them do) then I want to go get some additional user data about the supervisor and display it.
Here’s where I’m at… I have added the following code :
$testvar = 'No work'; if ($key === 'Supervisor') { $theSupervisor = get_user_by('display_name', $value); if ( ! empty( $theSupervisor ) ) { $testvar = 'it works'; } $value = $value . ', ' . $testvar; } $items[] = apply_filters( 'um_show_meta_item_html', '<p class="' . $key . '">' . $value . '</p>', $key );This displays $testvar as “No work.” The user object is not getting got.
I know the value of the “Supervisor” key is the display_name of a user (It has to be, because that’s what the script supplies to the field. Yet, $theSupervisor is empty.
Could it be that $value is NOT a string at this point? Its also possible that I bolloxed the syntax–but I don’t think so. Any ideas?
Thanks, as always.
–don
- This reply was modified 2 years, 11 months ago by theotherdon.
- This reply was modified 2 years, 11 months ago by theotherdon.
- This reply was modified 2 years, 11 months ago by theotherdon.
It worked!
Thank you for all of your help!
- This reply was modified 2 years, 11 months ago by theotherdon.
@missveronicatv — thanks for that! I have found the function, and I’m pretty sure I understand what its doing. Now, what’s the proper way to replace it?
Obviously, not by editing the core file! Do I copy class-profile.php into my theme file and edit it there? Do I use delete_action, add_action in my functions file? Or is there some other way?
That fixed it! Thank you.
RE: “Look in your
metadatatable with phpMyAdmin.”You scare me when you talk like that!
–don
Thanks for the quick reply!
#info img.avatar.um-avatar {margin-left: 0rem; margin-right: 4rem; width:Calc(30vw - 4rem) !important; height:Calc(30vw - 4rem) !important; border: 1px solid var(--ln-color); }Works as desired. I guess I’m better-off setting the size to something like 512, then letting the CSS scale the image down, rather than scaling a 96-pixel image up.
Now, I would much rather have rectangular images, than square ones–but I understand that issue belongs to Gravitar, not UM. So that work-around is for another day.
Thanks again for your help. I’m sure I’ll be back with more questions another time.
–don
That fixed it! Thank you.
I’ll be back with harder questions later <G>
–don
Missveronica-
Thanks for the quick response!
The setting that you pointed me to allows me to change the nickname part of mysite.org/user/nickname… what I want to change is the user part. I suspect it may be a harder process than I had hoped.
–don
Forum: Developing with WordPress
In reply to: Help listing child posts!Thanks! That was the piece I was missing. All is well (well, maybe not all, but this script, at least).
–don
Forum: Plugins
In reply to: [Contact Form 7] Using Custom Field content in a mail tag…Thanks for your response!
I notice that, if I choose “roles” as a filter, a menu appears wherein I can choose which role to filter on. This is how I would expect the function to work.
Using roles will not work for me-each group (departments within our organization) contains people who are admins, editors, contributors, and members.
I notice that, even though the information button shows a hint that says “…e.g., only show members from the USA” that selecting country does not give a list of values for the filter.
I am beginning to suspect that this function has not been fully implemented.
–don