So this plugin is awesome, but I want to be able to specify which fields a user can actually update in their profile, depending on which role they are registered as.
How can I do this?
This may not be the ideal approach, but I was able to hide fields (and their associated labels and the parent p/div/tr element) using a little jQuery, if you’re familiar with that. Just target the input to hide, climb up to its parent element, and hide it.
This assumes that the <input> element is nested 3 levels down from the element i actually need to hide.. a <tr> in my case. And i use a wp conditional to run this code only on the ‘edit-profile’ page.
First you’ll want to copy the profile form (theme-my-login/templates/profile-form.php) to your current theme directory. Then, editing that file, you’ll want to put the user role into a variable:
$user_role = reset( $profileuser->roles );
Once you have that, it’s just simple conditional statements:
<?php if ( 'subscriber' == $user_role ) : ?> HTML here <?php endif; ?>
thanks, i will give that a go.
also is it possible to exclude the admin role from having a themed profile?
In the development version, it is possible.
I downloaded the development version and have installed it on my test site. One suggestion I have so far is for the widget – can the “Dashboard” link be removed because effectively this is the same as the “Profile” link.
I’ll let u know if I find any other bugs – what are the other changes?
Just activate the Custom User Links module and you can remove the “Dashboard” link.
One more question…how can I alter the title of the profile page “Your Profile” and also the widget title “Welcome, username” or “Log In” depending on the state?
There doesn’t seem to be a line in the template?
This issue has been discussed numerous times here and on my forum. Please search on either one.
Well I did actually search over there and couldn’t find anything so if you could direct me to the solutions please?
It seems that the old posts may have been pruned…
I found an easier way to change the sidebar widget’s “Welcome” to whatever you want.
1.) In your WordPress install go to the folder: wordpress/wp-content/plugins/theme-my-login/includes/
2.) Open the file: class-theme-my-login-template.php
3.) Locate the word “Welcome” and replace it with whatever greeting you’d like. For example, replace “Welcome” with “Hello”.
4.) Save the edited class-theme-my-login-template.php document to wordpress/wp-content/plugins/theme-my-login/includes/
6.) Refresh the page. Now, instead of “Welcome” it should have “Hello” or whatever you put as your personal greeting.
@sassyfrass475 – I would never recommend modifying core files. What happens when you update the plugin? You lose the changes. This is why I’ve provided numerous hooks throughout the plugin, in order to customize it properly.
Thanks for the plugin. I found a way to hide profile fields using functions here: http://brassblogs.com/tidbits/hiding-information-from-the-wordpress-admin
Can this be adapted to use with TML?
- The topic ‘[Plugin: Theme My Login] Hide profile fields from theme my login?’ is closed to new replies.