Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'hide fields'

Viewing 25 results - 101 through 125 (of 260 total)
  • Author
    Search Results
  • #183084
    SimpleOne
    Participant

    @danbp,

    Thanks. I tried inserting your suggested code into my functions.php, but it did not hide the desire fields. Also, I looked at the references in the links you provided for me to read through. Thanks for those too. However, I’m still stuck on how to resolve my problem.

    Just to be clear… I think what I specifically need to figure out is how to add a filter to bp_the_profile_group_field_ids(), which apparently creates a list of the expected field names (for the specific group tab that I’m currently on) when I click “Save Changes” button on Profile Edit page. Until I can find a way to filter out my 3 desired “required” fields during the Save Changes button press, I will continue to receive the error message: “Please make sure you fill in all required fields in this profile field group before saving“.

    Is there some other type of coding I can try to insert inside functions.php to resolve this?

    #183075
    danbp
    Participant

    Hi @SimpleOne,

    read from line 154 in bp-xprofile-classes.php file. It contains many information for what you want to do.
    See also on Codex here and here

    You can also revert your changes back and use this kind of function (goes into theme’s functions.php or bp-custom.php):

    function simple_one_hide_some_profile_fields( $retval ) {	
    	
    	if(  bp_is_profile_edit() ) {		
    		$retval['exclude_fields'] = '48';	//field ID's separated by comma
    		
    	}	
    	
    	return $retval;
    	
    }
    add_filter( 'bp_after_has_profile_parse_args', 'simple_one_hide_some_profile_fields' );

    May this help ? šŸ˜‰

    #183038
    SimpleOne
    Participant

    Correction to my last post. I meant to say…

    I was able to successfully hide certain profile fields from being displaying (by modifying profile-loop.php). And I was able to hide the same fields from being displayed when a user goes to edit their profile (by modifying edit.php).

    NOTE: Both files are located in: /bp-templates/bp-legacy/buddypress/members/single/

    I still need help figuring out how to avoid the above-mentioned “required fields” error message upon clicking the Save Changes button.

    #183032
    SimpleOne
    Participant

    Oops… I just found a problem.

    The good news is that I was able to successfully hide certain profile fields from being displaying (by modifying profile.php). That part works great. Also, I was able to hide the same fields from being displayed when a user goes to edit their profile.

    However, the problem I just discovered is that if any of those fields that I’ve hidden (using the above code changes) are “required” fields, then when a user goes to the Edit Profile page, the following error message appears upon clicking the Save Changes button: “Please make sure you fill in all required fields in this profile field group before saving.”

    Even though I’m certain those hidden fields have values in them, that error message appears and there’s no way to save changes.

    Any solution to this?

    #181170
    serks
    Participant

    Hi have a very similar issue and I think it may be related to the same cause.

    I have set up a xprofile group where I have a bunch of different radio fields like so…

    About You Widget
    Show | Hide

    Display Avatar On Profile
    Show | Hide

    Subscribed Member Badge
    Show | Hide

    etc.

    I have put code all around my website to show or hide things according to a users settings and it all works as it should BUT, the only problem is that the settings don’t take effect until a user goes to edit the particular profile group and clicks the ‘Save Changes’ button.

    Even though the defaults are set as they should be initially, they do not actually work until the user saves them.

    Any help on this issue would be much appreciated.

    Thanks

    #179742
    Sowulo
    Participant

    Proposed solution solves the issue partly. Delete div class=ā€item-list-tabsā€ role=ā€navigationā€in your-theme/members/index.php lead to reflection of request which works right. But if you clear filter fields or refresh the page then the full list of members is appear.

    Appreciate if somebody can help to fix the issues above and hide the full list reflecting only results by search.

    Thank you in advance,
    Anton

    #176347
    Hugo Ashmore
    Participant

    You’re not attempting to hide anything, if you have created xprofile field groups other than the default ‘Base’ then anything in those groups for user profile input will not show on the standard BP registration form only on the users account profile screen. If you are following that principle and those fields are showing on the main registration form then something is going wrong and likely you have third party plugins at work?

    #175772
    Shmoo
    Participant

    It’s my theme and I code WordPress themes for like 5 years now but I don’t see myself as a Developer it’s more a hobby šŸ™‚

    I’m solid at HTML-CSS and can read PHP when I see it happen but I can’t write PHP it out of the box.

    This error shows up when I try to hide a complete xProfile-group-ID or just an unique xProfile-field-ID from the loop.

    This is what I did.
    Inside: my-theme/buddypress/members/single/profile/profile-loop.php
    I found the start of the loop

    
    <?php if ( bp_has_profile() ) : ?>
    ....
    

    My first thought was, maybe there are default options here to control the output of which ID’s will be visible so I started the search how the bp_has_profile() was build and looked into plugins/buddypress/bp-xprofile/bp-xprofile-template.php and found this at line 150:

    
    ....
    
    $defaults = array(
    	'user_id'             => bp_displayed_user_id(),
    	'profile_group_id'    => false,
    	'hide_empty_groups'   => true,
    	'hide_empty_fields'   => $hide_empty_fields_default,
    	'fetch_fields'        => true,
    	'fetch_field_data'    => true,
    	'fetch_visibility_level' => $fetch_visibility_level_default,
    	'exclude_groups'      => false, // Comma-separated list of profile field group IDs to exclude
    	'exclude_fields'      => false  // Comma-separated list of profile field IDs to exclude
    );
    

    This looks very familiar to bbPress so my first thoughts was lets try to add one of those Array’s to the loop and overwrite the default value.
    Just like this.

    
    <?php if ( bp_has_profile( array ( 'exclude_groups' => 1 ) ) ) : ?>
    ...
    

    This works perfect, it hides all xProfile-fields from the first Base primary Tab (back-end). Just like I wanted it because I didn’t want all the fields to show up front-end, I’ve got a few xProfile-fields that I use for user-customization of the profile-page. Each user can add color-codes to change the default menu-color and add background-images to their profile-page to make each profile a little more unique.
    Those field-ID’s are just urls or color-codes and don’t have to be visable to the public, thats why I try to hide them front-end.

    buddypress member pofile tab

    #174519
    Martyn_
    Participant

    * Better options for users to self delete

    Expanding. Without backend access, it would be nice for a site allow a user to delete in several ways. Purge all their profile fields and networks (‘destroy all personal data’), Retain their profile fields and networks whilst making it look like they have vanished (‘hide’ if you like), Delete Uterly.

    * Multiple networks. We have friends, and with plugins one sided friendships (aka followers). sometimes its useful to have different types of relationships identified – “close friends” or “have done business with” or “merely online buddies”. It would be nice for an admin to be able to define additional types of friendships either independently, or by associating a scale (an integer valued friendship, 1=I want to see your feed stuff 2=online mates 3=actual real life chums 4=we’re married).

    #173441
    jaxdestroyer
    Participant

    The only way I know how to hide it currently is through css. BP will give your sub group a class name based on what you sub group is called. For example, my sub group is About Me. The class name is about-me.

    To make sure you are getting the right class name I suggest you use Firefox firebug or chromes built in element inspector. You should also see another class name of bg-widget when using either tool.

    To make the css specific for that particular snippet all you need to do in your Themes or BuddyPress child themes style.css

    .bp-widget.about-me{
        display: none;
    }

    This will hide the whole sub group when someone is viewing the profile. It makes sure it has both class names before making it no longer display so the user can still see it when editing their profile.

    If you want to only get rid of specific rows that contain this information then BP still has you covered. They also make a class based on your input field name. Using Facebook as an example again the class is field_facebook. To be as specific as possible without going too overboard in your Themes or BuddyPress child themes style.css put in

    table.profile-fields tr.field_facebook{
       display:none;
    }

    This will only get rid of the one row, however, there is a caveat. If you alternate colors between rows it will still count the hidden field. I suggest that if you are going to use this make sure that the fields are at the bottom of the group so they no longer break flowof alternating colors.

    If you want to do multiple fields just seperate them via a comma as shown below

    table.profile-fields tr.field_facebook,
    table.profile-fields tr.field_twiitter{
       display:none;
    }
    #173437
    noizeburger
    Participant

    Now, that your code makes it possible to show icons in my profile header, is there a way to hide the profile group that helds my input fields? Main reason is, that my youtube and twitter links won’t show in the fieldgroup as a result of the use of a snippet to use oembed-code in my profiles.

    #172035
    martinbeaulne
    Participant

    If i hide the bottom tabs and the admin bar, each user can’t modify their profile.

    #171233
    Ben Hansen
    Participant

    you can’t really hid the entire profile out of the box but you can hide most of the fields and info by setting the default visibility in the profile field setup screens.

    #167792
    nobodymove
    Participant

    @bphelp. I think I have discovered the culprit to this little mystery.. I have been using the Buddypress Members Import plugin: http://www.youngtechleads.com/buddypress-members-import/

    For some reason when I import my database, the plugin does not seem to process the xProfile Field visibility settings properly.. The profile fields are still listed as “Admins Only” But for some reason they are still visible to all users.

    Earlier, I manually added some new test profile fields and they worked fine. I also discovered, that if I edit, and re-save a user’s profile field after import, all profile fields for that user will then revert to the proper visibility settings.

    I have contacted the plugin author to make him aware of the issue, hopefully he can fix it. If you have any suggestions that might be a quick fix for this I’m all ears! šŸ™‚

    #167767
    nobodymove
    Participant

    @bphelp. Upon a little further research, I wanted to note that I created a new User Profile Group, created a private field seen by Admins Only in that group, and the settings seem to be working fine in that group. In my Base (Primary) group though, all profile fields still remain visible to all users. Does the Base (Primary) group automatically force all fields visibility public by default? If so, is there way to override?

    If there is no way to change the visibility in the Base (Primary), I suppose I can just put private info in the other Profile Group, but I’m curious if or how that may effect my database import..

    #167443
    nobodymove
    Participant

    Thanks @bphelp. Info listed below:

    1. Which version of WordPress are you running?

    3.5.2

    2. Did you install WordPress as a directory or subdomain install?

    Directory

    3. If a directory install, is it in root or in a subdirectory?

    root

    4. Did you upgrade from a previous version of WordPress? If so, from which version?

    3.5

    5. Was WordPress functioning properly before installing/upgrading BuddyPress (BP)? e.g. permalinks, creating a new post, commenting.

    Wordpress seems to be working fine

    6. Which version of BP are you running?

    1.7.2

    7. Did you upgraded from a previous version of BP? If so, from which version?

    1.7

    8. Do you have any plugins other than BuddyPress installed and activated? If so, which ones?

    Yes, a lot. šŸ™‚

    Allow Multiple Accounts
    amr users + buddypress
    buddypress group email subscription
    buddypress member import
    buddypress message attachement
    Buddypress Toolbar
    Buddypress Xprofile custom fields type
    comprehensive google map
    contact form manager
    events manager pro
    easy table
    form lightbox
    GRAND Flash Album Gallery
    Lightbox Galleries EWSEL
    Mass Messaging in Buddypress
    Online Backup for WordPress
    Peter’s Login Redirect
    SHortcode Widget
    User Switching
    WP Full Calendar
    WP Wunderground

    9. Are you using the standard BuddyPress themes or customized themes?

    I’m using Razor 1.1.3 from Themeforest/Parallelus

    10. Have you modified the core files in any way?

    No

    11. Do you have any custom functions in bp-custom.php?

    No

    12. If running bbPress, which version? Or did your BuddyPress install come with a copy of bbPress built-in?

    13. Please provide a list of any errors in your server’s log files.

    14. Which company provides your hosting?

    Network Solutions

    15. Is your server running Windows, or if Linux; Apache, nginx or something else?

    VPS hosting package

    #166414
    modemlooper
    Moderator

    You can hide fields from being edited easy. in members/single/edit.php you can exclude fields by ID. Use comma separated list.

    if ( bp_has_profile( 'profile_group_id=' . bp_get_current_profile_group_id() . '&exclude_fields=2,3,4' ) ) :

    full code example https://gist.github.com/modemlooper/5816548

    #166035

    In reply to: Dynamic profile fields

    Henry
    Member

    @hnla

    Loving the second approach! although not as clean as the first approach, it’ll be much easier to do. jQuery show, hide and toggle could all be used to get the desired effect! i’m going to have a crack at it this weekend…

    #166029

    In reply to: Dynamic profile fields

    Hugo Ashmore
    Participant

    @4ella one bump is sufficient!

    @henrywright-1I think this is going to have attendant issues difficult to deal with. Gravity forms allows for forms with repeater fields and you can then tie submissions into existing functionality but profile fields are going to be hard to deal with, if they aren’t created. The repeater fields are created via JS on submission you have to tie it in to creating new profile field label etc then if you can do that you create those extra for all users.

    What may be a better approach is to add in advance all the fields you may need then on front end hide them with JS and allow user to show them as and when needed, public profile would be set to ignore any empty fields & labels.

    #165641
    junithorn
    Participant

    Just an FYI to anyone curious, here is the solution:

    <?php do_action( 'bp_before_profile_loop_content' ); ?>
    
    <?php if ( bp_has_profile('hide_empty_fields=0') ) : ?>
    
    	<?php while ( bp_profile_groups() ) : bp_the_profile_group(); ?>
    
    		<?php if ( bp_profile_group_has_fields() ) : ?>
    
    			<?php do_action( 'bp_before_profile_field_content' ); ?>
    
    			<div class="bp-widget <?php bp_the_profile_group_slug(); ?>">
    
    				<h4><?php bp_the_profile_group_name(); ?></h4>
    
    				<table class="profile-fields">
    
    					<?php while ( bp_profile_fields() ) : bp_the_profile_field('hide_empty_fields=0'); ?>
    
    						<?php if ( bp_field_has_data() ) : ?>
    
    							<tr<?php bp_field_css_class(); ?>>
    
    								<td class="label"><?php bp_the_profile_field_name(); ?></td>
    
    								<td class="data"><?php bp_the_profile_field_value(); ?></td>
    
    							</tr>
    							
    						<?php elseif ( !bp_field_has_data() ) : ?>
    						
    								<tr<?php bp_field_css_class(); ?>>
    
    								<td class="label"><?php bp_the_profile_field_name(); ?></td>
    
    								<td class="data"><?php bp_the_profile_field_value(); ?></td>
    
    							</tr>
    							
    						<?php endif; ?>
    
    						<?php do_action( 'bp_profile_field_item' ); ?>
    
    					<?php endwhile; ?>
    
    				</table>
    			</div>
    
    			<?php do_action( 'bp_after_profile_field_content' ); ?>
    
    		<?php endif; ?>
    
    	<?php endwhile; ?>
    
    	<?php do_action( 'bp_profile_field_buttons' ); ?>
    
    <?php endif; ?>
    
    <?php do_action( 'bp_after_profile_loop_content' ); ?>
    
    #163334
    rypo73
    Participant

    @chouf1

    OK – you’re onto something… And it seems your initial hunch of PBCK was spot on – feeling foolish, but enlightened now!

    SO… I had some code in my custom-functions.php file to ‘hide’ the site admin activity (see below). Because we have several users with ‘Administrator’ roles, it seems this particular user was affected. Others MAY have been if they had logged in more often…

    Seems this code was not the best to use:
    // Don’t record activity by the site admins or show them as recently active
    function my_admin_stealth_mode(){
    if ( is_site_admin() ) {
    global $bp;
    remove_action(‘wp_head’,’bp_core_record_activity’);
    delete_user_meta($bp->loggedin_user->id, ‘last_activity’);
    }
    }
    add_action(‘init’,’my_admin_stealth_mode’);

    SO I’ve removed it in favour of THIS version, specifically masking the activity of INDIVIDUAL users with ‘Administrator’ roles, like our site admin user.

    // Don’t record activity for a user or show them as recently active
    function my_user_stealth_mode(){
    $current_user = wp_get_current_user();
    if(is_user_logged_in()) {
    if(‘YourUsername’ == $current_user->user_login) {
    remove_action(‘wp_head’,’bp_core_record_activity’);
    delete_user_meta($current_user->ID, ‘last_activity’);
    }
    }
    }
    add_action(‘init’,’my_user_stealth_mode’);

    Hope it might be of use to others in future. Thanks for responding to my post. I’m now a LOT more familiar with meta data fields as a result.

    p.s. you’re right about # plugins, we do need a lot, but not ALL of those. It’s our dev environment after all. Often a case of playing with different ones to see what fits the bill.

    #145683
    Ben Hansen
    Participant

    streams are not related to profile fields. stream is created by site activity. i don’t think theres a decent way to hide that other then for admin users using a plugin or by modifying code stuff.

    #144322
    David Cavins
    Keymaster

    I think a better bet is to collect that info on the BP registration page and then not display it on the user profile (that way you’ll still be able to use it in other ways). With BP 1.6. you can change the visibility of each xprofile field to friends only, logged-in users, or public (and force that level or allow the user to override your selection). (Visible to admin only is coming in BP 1.7, btw, which would totally fix you up.) At the moment, you can modify your theme template file (themes/yourtheme/members/single/profile/profile-loop.php) to hide some fields like this:
    `about line 17:

    <?php $no_display_fields = array( // Enter the field name of any field that you don't want to appear on the user profile.
    ‘E-mail’,
    ‘Name of Field Hide’,
    ‘Another’
    );

    if ( bp_field_has_data() && !in_array( bp_get_the_profile_field_name(), $no_display_fields ) ) : ?>`

    It’s a hack, but it works for me (until BP 1.7).

    #143993

    Sure. You could just make all the fields optional and then hide them via CSS on your registration page.

    #143525
    benzine
    Participant

    I’m in despair for such a solution right now. So, I think it’s better to have all custom fields mandatory while members can decide whether to hide or show them in public such that they can edit any fields later if they want to. Also, re-register from front end all manually created profiles from dashboard. This is the most plausible solution to me at this time.

    Thanks for your time.

Viewing 25 results - 101 through 125 (of 260 total)
Skip to toolbar