Support » Plugin: Theme My Login » [Plugin: Theme My Login] Hide profile fields from theme my login?

Viewing 15 replies - 1 through 15 (of 18 total)
  • 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.

    <?php
    // this code goes in header.php, in the <head> section.
    if(is_page('edit-profile') ) { ?>
    	<script type="text/javascript">
    		jQuery(document).ready(function() {
    			// hide fields (the entire <tr>)
    			jQuery('#id-of-field').parent().parent().parent().hide();
    		});
    	</script>
    <?php }

    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.

    Plugin Author Jeff Farthing

    (@jfarthing84)

    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?

    Plugin Author Jeff Farthing

    (@jfarthing84)

    In the development version, it is possible.

    Cool stuff, any idea of an ETA?

    Hi Jeff,

    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?

    Plugin Author Jeff Farthing

    (@jfarthing84)

    Just activate the Custom User Links module and you can remove the “Dashboard” link.

    Sweet!

    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?

    Plugin Author Jeff Farthing

    (@jfarthing84)

    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?

    Plugin Author Jeff Farthing

    (@jfarthing84)

    It seems that the old posts may have been pruned…

    Try this one: http://wordpress.org/support/topic/plugin-theme-my-login-change-page-title-for-profile-page

    I found an easier way to change the sidebar widget’s “Welcome” to whatever you want.

    DIRECTIONS

    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.

    Plugin Author Jeff Farthing

    (@jfarthing84)

    @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.

    Hi Jeff,

    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?

    Plugin Author Jeff Farthing

    (@jfarthing84)

    Of course it can. But why use javascript to remove the fields when TML let’s you do it with a template? What happens if someone turns off javascript? Oops, now they see the hidden fields. I hope you’re not hiding anything sensitive like that.

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘[Plugin: Theme My Login] Hide profile fields from theme my login?’ is closed to new replies.