Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'hide xprofile fields'

Viewing 25 results - 1 through 25 (of 129 total)
  • Author
    Search Results
  • lbnn
    Participant

    Hello,

    I modified the profile-loop.php file some time ago to hide profile fields that are empty but my code doesn’t work anymore, has any change been done to the code some updates ago ?

    Here is what I modified :

    <h2 class="screen-heading view-profile-screen"><?php esc_html_e( 'View Profile', 'buddypress' ); ?></h2>
    
    <?php bp_nouveau_xprofile_hook( 'before', '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 bp_nouveau_xprofile_hook( 'before', 'field_content' ); ?>
    
    			<div class="bp-widget <?php bp_the_profile_group_slug(); ?>">
    
    				<h3 class="screen-heading profile-group-title">
    					<?php bp_the_profile_group_name(); ?>
    				</h3>
    
    				<table class="profile-fields bp-tables-user">
    
    					<?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 bp_nouveau_xprofile_hook( '', 'field_item' ); ?>
    
    					<?php endwhile; ?>
    
    				</table>
    			</div>
    
    			<?php bp_nouveau_xprofile_hook( 'after', 'field_content' ); ?>
    
    		<?php endif; ?>
    
    	<?php endwhile; ?>
    
    	<?php bp_nouveau_xprofile_hook( '', 'field_buttons' ); ?>
    
    <?php endif; ?>
    
    <?php
    bp_nouveau_xprofile_hook( 'after', 'loop_content' );
    

    Can someone help me to hode those fields again please 🙂

    petertucker
    Participant

    Here is the solution for anyone who is going to see this post in the future.

    1. Install the username change plugin:
    https://buddydev.com/plugins/bp-username-changer/
    2. Add to the plugins code (bp-change-username.php) on line 163;

    
    xprofile_set_field_data(1, $user_id,  $new_user_name);
    

    3. In your theme function.php file add the follow code to hide XProfile editing:

    
    function bpfr_hide_profile_field_group( $retval ) {
            if ( bp_is_active( 'xprofile' ) ) :     
    
            // hide profile group/field to all except admin 
            if ( !is_super_admin() ) {
                    //exlude fields, separated by comma
                    $retval['exclude_fields'] = '1';  
                    //exlude groups, separated by comma
                    //$retval['exclude_groups'] = '1';
            } 
            return $retval;         
    
            endif;
    }
    add_filter( 'bp_after_has_profile_parse_args', 'bpfr_hide_profile_field_group' );
    

    I hope this helps anyone who finds it.

    beekoff
    Participant

    Hi – I’ve run into an issue (via BP Member Types Pro plugin) where the registration button won’t submit under the following circumstance:

    – the registration form contains required xprofile fields that have been conditionally hidden

    The plugin itself is doing its job of first associating xprofile fields with member roles, and then allowing them to conditionally show/hide on the registration form as needed (based on member roles). But in turns out that such a form won’t submit, as the code running the registration process is still checking for any of these fields that are required (even though they’re hidden). It’s not distinguishing. I’ve touched base with the plugin’s developer (Brajesh @ BuddyDev) and he’s said, “I do agree that there should be a simple way for [developers] to mark a field as non required (in html attributes). It is still doable but too complex at the moment. Please do report it.”

    Might anyone have a workaround?

    Much thanks,
    Sam

    #302438
    msteimann
    Participant

    Thanks for your quick reply, Venutius!

    I have tried the WP 2015 Theme and got the same results. So I switched back to KLEO and noticed, that the xProfile fields do change to the desired visibility settings, AFTER the user clicks the SAVE SETTINGS button. So I guess I was confused by the fact that BEFORE you hit the save button there is a misleading visual feedback (the visibility term does not alter to the according setting the user has just changed it to, it still displays the same value as before).

    Could this be changed in the next release?

    My first problem still remains: the „change display name visibility option“ is displayed beneath the name field on the user Registration page. This doesn’t make sense, if the name’s visibility throughout BuddyPress network is mandatory. How can I get rid of this line? Does this line and it’s user changeable visibility options really not appear on a default install?

    In the WP Dashboard I cannot change the options for the primary Name field. Only the fields under the details tab can be altered by admin and set to be visibility-changeable by the user. (Hope you understand what I try to say 😉

    Regards,
    Martin

    Hide visibility option on registration page?

    #302171
    sedmikraska
    Participant

    I want all profile fields to be visible on my site. So I want to remove the subnav Settings > Profile Visibility.

    I have added below command into bp-custom.php but it does not work.

    function bpfr_hide_visibility_tab() {
    if( bp_is_active( ‘xprofile’ ) )

    bp_core_remove_subnav_item( ‘settings’, ‘profile’ );

    }
    add_action( ‘bp_ready’, ‘bpfr_hide_visibility_tab’ );

    Something has changed probably because the conversation I found about this issue is two years old.

    Could you please let me know updated command that I have to use ?

    WordPress: 5.0.3–sk_SK
    BuddyPress: 4.1.0
    mamatwist.com

    Thank you,
    Dana

    olandir
    Participant

    I have a corporate Intranet running on WordPress 4.9.8 and BuddyPress 3.1.0

    I have specific xprofile fields that I’d like only editable to people who have the “Edit Users” capability.

    I’ve seen snippets of code here or there that almost do what I’m looking for but everything I’ve found is old and out of date.

    Could someone help me with this.

    Basically I need the PHP equivalent of

    If we’re on the edit BuddyPress profile page AND user does not have the “edit users” capability then hide profile fields with X id(s).

    I’d also be happy with specifying a role instead of capability as long as I can specify multiple role ids.

    Thank you in advance.

    lz430
    Participant

    Hey everyone,
    I have a membership site. It’s running Woocommerce, WP 4.9.6 and Buddypress 3.0.0. My BuddyPress status is below.

    I’m having a problem when someone is choosing a any kind of membership(I only have free and 1 paid at the moment). When they get to the billing screen they can either use Facebook or Google to login and fill in the details.

    Once they do that, Buddypress redirects them to their wall. I want them to be able to continue the checkout process. I’ve tried so many things, but can’t override it.

    Please help!

    
    ### WordPress Environment ###
    
    Home URL: http://www.specialtactics.global
    Site URL: http://www.specialtactics.global
    WC Version: 3.4.1
    Log Directory Writable: ✔
    WP Version: 4.9.6
    WP Multisite: –
    WP Memory Limit: 256 MB
    WP Debug Mode: –
    WP Cron: ✔
    Language: en_US
    External object cache: –
    
    ### Server Environment ###
    
    Server Info: Apache
    PHP Version: 7.1.16 - We recommend using PHP version 7.2 or above for greater performance and security. How to update your PHP version
    PHP Post Max Size: 128 MB
    PHP Time Limit: 3000
    PHP Max Input Vars: 1000
    cURL Version: 7.54.0
    OpenSSL/1.0.2k
    
    SUHOSIN Installed: –
    MySQL Version: 5.6.39-cll-lve
    Max Upload Size: 128 MB
    Default Timezone is UTC: ✔
    fsockopen/cURL: ✔
    SoapClient: ✔
    DOMDocument: ✔
    GZip: ✔
    Multibyte String: ✔
    Remote Post: ✔
    Remote Get: ✔
    
    ### Database ###
    
    WC Database Version: 3.4.1
    WC Database Prefix: wp_
    MaxMind GeoIP Database: ✔
    Total Database Size: 11.24MB
    Database Data Size: 10.10MB
    Database Index Size: 1.14MB
    wp_woocommerce_sessions: Data: 0.04MB + Index: 0.00MB
    wp_woocommerce_api_keys: Data: 0.00MB + Index: 0.00MB
    wp_woocommerce_attribute_taxonomies: Data: 0.00MB + Index: 0.00MB
    wp_woocommerce_downloadable_product_permissions: Data: 0.00MB + Index: 0.00MB
    wp_woocommerce_order_items: Data: 0.00MB + Index: 0.00MB
    wp_woocommerce_order_itemmeta: Data: 0.00MB + Index: 0.01MB
    wp_woocommerce_tax_rates: Data: 0.00MB + Index: 0.00MB
    wp_woocommerce_tax_rate_locations: Data: 0.00MB + Index: 0.00MB
    wp_woocommerce_shipping_zones: Data: 0.00MB + Index: 0.00MB
    wp_woocommerce_shipping_zone_locations: Data: 0.00MB + Index: 0.00MB
    wp_woocommerce_shipping_zone_methods: Data: 0.00MB + Index: 0.00MB
    wp_woocommerce_payment_tokens: Data: 0.00MB + Index: 0.00MB
    wp_woocommerce_payment_tokenmeta: Data: 0.00MB + Index: 0.00MB
    wp_woocommerce_log: Data: 0.00MB + Index: 0.00MB
    ts_redirects: Data: 0.00MB + Index: 0.00MB
    wp_achievements: Data: 0.02MB + Index: 0.01MB
    wp_bp_activity: Data: 0.01MB + Index: 0.01MB
    wp_bp_activity_meta: Data: 0.00MB + Index: 0.01MB
    wp_bp_friends: Data: 0.00MB + Index: 0.00MB
    wp_bp_groups: Data: 0.00MB + Index: 0.00MB
    wp_bp_groups_groupmeta: Data: 0.00MB + Index: 0.00MB
    wp_bp_groups_members: Data: 0.00MB + Index: 0.00MB
    wp_bp_links: Data: 0.00MB + Index: 0.00MB
    wp_bp_links_categories: Data: 0.00MB + Index: 0.00MB
    wp_bp_links_linkmeta: Data: 0.00MB + Index: 0.00MB
    wp_bp_links_votes: Data: 0.00MB + Index: 0.00MB
    wp_bp_messages_drafts: Data: 0.00MB + Index: 0.00MB
    wp_bp_messages_labels: Data: 0.00MB + Index: 0.00MB
    wp_bp_messages_label_message: Data: 0.00MB + Index: 0.00MB
    wp_bp_messages_messages: Data: 0.00MB + Index: 0.00MB
    wp_bp_messages_meta: Data: 0.00MB + Index: 0.00MB
    wp_bp_messages_notices: Data: 0.00MB + Index: 0.00MB
    wp_bp_messages_recipients: Data: 0.00MB + Index: 0.00MB
    wp_bp_notifications: Data: 0.00MB + Index: 0.00MB
    wp_bp_notifications_meta: Data: 0.00MB + Index: 0.00MB
    wp_bp_user_blogs: Data: 0.00MB + Index: 0.00MB
    wp_bp_user_blogs_blogmeta: Data: 0.00MB + Index: 0.01MB
    wp_bp_xprofile_data: Data: 0.00MB + Index: 0.00MB
    wp_bp_xprofile_fields: Data: 0.03MB + Index: 0.05MB
    wp_bp_xprofile_groups: Data: 0.00MB + Index: 0.00MB
    wp_bp_xprofile_meta: Data: 0.01MB + Index: 0.02MB
    wp_buddyboss_media: Data: 0.00MB + Index: 0.00MB
    wp_buddyboss_media_albums: Data: 0.00MB + Index: 0.00MB
    wp_commentmeta: Data: 0.00MB + Index: 0.01MB
    wp_comments: Data: 0.01MB + Index: 0.01MB
    wp_gde_profiles: Data: 0.00MB + Index: 0.00MB
    wp_gde_secure: Data: 0.00MB + Index: 0.00MB
    wp_learndash_user_activity: Data: 0.01MB + Index: 0.03MB
    wp_learndash_user_activity_meta: Data: 0.04MB + Index: 0.03MB
    wp_links: Data: 0.00MB + Index: 0.00MB
    wp_options: Data: 2.97MB + Index: 0.09MB
    wp_pmpro_discount_codes: Data: 0.00MB + Index: 0.00MB
    wp_pmpro_discount_codes_levels: Data: 0.00MB + Index: 0.00MB
    wp_pmpro_discount_codes_uses: Data: 0.00MB + Index: 0.00MB
    wp_pmpro_memberships_categories: Data: 0.00MB + Index: 0.00MB
    wp_pmpro_memberships_pages: Data: 0.00MB + Index: 0.00MB
    wp_pmpro_memberships_users: Data: 0.00MB + Index: 0.01MB
    wp_pmpro_membership_levelmeta: Data: 0.00MB + Index: 0.00MB
    wp_pmpro_membership_levels: Data: 0.00MB + Index: 0.01MB
    wp_pmpro_membership_orders: Data: 0.00MB + Index: 0.02MB
    wp_pmxi_files: Data: 0.00MB + Index: 0.00MB
    wp_pmxi_history: Data: 0.00MB + Index: 0.00MB
    wp_pmxi_imports: Data: 0.00MB + Index: 0.00MB
    wp_pmxi_posts: Data: 0.00MB + Index: 0.00MB
    wp_pmxi_templates: Data: 0.00MB + Index: 0.00MB
    wp_postmeta: Data: 0.83MB + Index: 0.21MB
    wp_posts: Data: 2.47MB + Index: 0.17MB
    wp_pp_login_builder: Data: 0.01MB + Index: 0.00MB
    wp_pp_password_reset_builder: Data: 0.01MB + Index: 0.00MB
    wp_pp_registration_builder: Data: 0.01MB + Index: 0.00MB
    wp_revslider_css: Data: 0.09MB + Index: 0.00MB
    wp_revslider_layer_animations: Data: 0.00MB + Index: 0.00MB
    wp_revslider_navigations: Data: 0.00MB + Index: 0.00MB
    wp_revslider_sliders: Data: 0.02MB + Index: 0.00MB
    wp_revslider_slides: Data: 0.18MB + Index: 0.00MB
    wp_revslider_static_slides: Data: 0.00MB + Index: 0.00MB
    wp_signups: Data: 0.00MB + Index: 0.00MB
    wp_social_users: Data: 0.00MB + Index: 0.00MB
    wp_termmeta: Data: 0.00MB + Index: 0.01MB
    wp_terms: Data: 0.00MB + Index: 0.01MB
    wp_term_relationships: Data: 0.00MB + Index: 0.01MB
    wp_term_taxonomy: Data: 0.00MB + Index: 0.01MB
    wp_usermeta: Data: 0.05MB + Index: 0.04MB
    wp_users: Data: 0.00MB + Index: 0.01MB
    wp_waiting: Data: 0.00MB + Index: 0.00MB
    wp_wc_download_log: Data: 0.00MB + Index: 0.00MB
    wp_wc_webhooks: Data: 0.00MB + Index: 0.00MB
    wp_wfBadLeechers: Data: 0.00MB + Index: 0.00MB
    wp_wfBlockedCommentLog: Data: 0.00MB + Index: 0.00MB
    wp_wfBlockedIPLog: Data: 0.00MB + Index: 0.00MB
    wp_wfBlocks7: Data: 0.00MB + Index: 0.00MB
    wp_wfConfig: Data: 0.36MB + Index: 0.01MB
    wp_wfCrawlers: Data: 0.00MB + Index: 0.00MB
    wp_wfFileChanges: Data: 0.00MB + Index: 0.00MB
    wp_wfFileMods: Data: 0.48MB + Index: 0.11MB
    wp_wfHits: Data: 0.14MB + Index: 0.03MB
    wp_wfHoover: Data: 0.00MB + Index: 0.00MB
    wp_wfIssues: Data: 0.00MB + Index: 0.00MB
    wp_wfKnownFileList: Data: 0.97MB + Index: 0.12MB
    wp_wfLeechers: Data: 0.00MB + Index: 0.01MB
    wp_wfLiveTrafficHuman: Data: 0.00MB + Index: 0.00MB
    wp_wfLocs: Data: 0.00MB + Index: 0.00MB
    wp_wfLogins: Data: 0.01MB + Index: 0.00MB
    wp_wfNet404s: Data: 0.00MB + Index: 0.00MB
    wp_wfNotifications: Data: 0.00MB + Index: 0.00MB
    wp_wfPendingIssues: Data: 0.00MB + Index: 0.00MB
    wp_wfReverseCache: Data: 0.00MB + Index: 0.00MB
    wp_wfScanners: Data: 0.00MB + Index: 0.00MB
    wp_wfSNIPCache: Data: 0.00MB + Index: 0.00MB
    wp_wfStatus: Data: 0.06MB + Index: 0.03MB
    wp_wfVulnScanners: Data: 0.00MB + Index: 0.00MB
    wp_wp_pro_quiz_category: Data: 0.00MB + Index: 0.00MB
    wp_wp_pro_quiz_form: Data: 0.00MB + Index: 0.00MB
    wp_wp_pro_quiz_lock: Data: 0.00MB + Index: 0.00MB
    wp_wp_pro_quiz_master: Data: 0.02MB + Index: 0.00MB
    wp_wp_pro_quiz_prerequisite: Data: 0.00MB + Index: 0.00MB
    wp_wp_pro_quiz_question: Data: 1.24MB + Index: 0.03MB
    wp_wp_pro_quiz_statistic: Data: 0.01MB + Index: 0.00MB
    wp_wp_pro_quiz_statistic_ref: Data: 0.00MB + Index: 0.00MB
    wp_wp_pro_quiz_template: Data: 0.00MB + Index: 0.00MB
    wp_wp_pro_quiz_toplist: Data: 0.00MB + Index: 0.00MB
    wp_wsluserscontacts: Data: 0.00MB + Index: 0.00MB
    wp_wslusersprofiles: Data: 0.00MB + Index: 0.00MB
    
    ### Post Type Counts ###
    
    attachment: 121
    bmt-member-type: 4
    bp-email: 32
    cdfc: 1
    condition_group: 1
    custom_css: 1
    customize_changeset: 9
    forum: 1
    jetpack_migration: 2
    mc4wp-form: 1
    nav_menu_item: 33
    page: 39
    post: 24
    product: 12
    revision: 1003
    scheduled-action: 16
    sfwd-certificates: 1
    sfwd-courses: 7
    sfwd-lessons: 36
    sfwd-quiz: 38
    sfwd-topic: 147
    shop_order: 7
    shop_subscription: 5
    sidebar: 1
    sp_wps_shortcodes: 1
    topic: 4
    wc_membership_plan: 6
    wcps: 1
    woocarousel: 1
    wpachievements: 3
    wpcf7_contact_form: 1
    wpe_product_carousel: 1
    yith_wcps_type: 1
    
    ### Security ###
    
    Secure connection (HTTPS): ❌
    					Your store is not using HTTPS. Learn more about HTTPS and SSL Certificates.
    Hide errors from visitors: ✔
    
    ### Active Plugins (50) ###
    
    Addons for WPBakery Page Builder: by Livemesh – 1.9.1
    Akismet Anti-Spam: by Automattic – 4.0.7
    bbPress: by The bbPress Community – 2.5.14
    Better Search Replace: by Delicious Brains – 1.3.2
    Boss for LearnDash: by BuddyBoss – 1.3.0
    BP Redirect To Profile: by Brajesh Singh – 1.2.2
    BuddyBoss Inbox: by BuddyBoss – 1.1.3
    BuddyBoss Media: by BuddyBoss – 3.2.4
    BuddyBoss One Click Installer: by BuddyBoss – 1.0.6
    BuddyBoss Wall: by BuddyBoss – 1.3.3
    BuddyPress for LearnDash: by BuddyBoss – 1.2.4
    BuddyPress Member Types: by BuddyBoss – 1.1.2
    BuddyPress: by The BuddyPress Community – 3.0.0
    Contact Form 7: by Takayuki Miyoshi – 5.0.2
    Force HTTPS: by LittleBizzy – 1.0.6
    Google Doc Embedder: by Kevin Davis
    Dan Lester – 2.6.4
    
    Insert or Embed Articulate Content into WordPress Trial: by Brian Batt – 4.292
    WPBakery Page Builder: by Michael M - WPBakery.com – 5.4.7
    LearnDash Content Cloner: by WisdmLabs – 1.2.2
    LearnDash & bbPress Integration: by LearnDash – 2.0.2.1
    LearnDash Course Grid: by LearnDash – 1.4.1
    LearnDash ProPanel: by LearnDash – 2.1.3
    LearnDash WooCommerce Integration: by LearnDash – 1.4.0 – Not tested with the active version of WooCommerce
    Mega Addons For Visual Composer: by Nasir – 2.2
    Nextend Social Login: by Nextendweb – 3.0.10
    Nextend Social Login Pro Addon: by Nextendweb – 3.0.8
    WooCommerce Product Carousel Slider: by ADL Plugins – 3.0.2 – Not tested with the active version of WooCommerce
    Restrict Content: by Pippin Williamson – 2.2.3
    Slider Revolution: by ThemePunch – 5.4.7.3
    LearnDash LMS: by LearnDash – 2.5.8.2
    Simple Buddypress Profile Privacy: by Justin Hansen – 0.7.7
    String Locator: by Clorith – 2.3.0
    Theme My Login: by Jeff Farthing – 6.4.16
    Uncanny LearnDash Toolkit: by Uncanny Owl – 2.4.2
    Uncanny LearnDash Toolkit Pro: by Uncanny Owl – 2.3.1
    UpdraftPlus - Backup/Restore: by UpdraftPlus.Com
    DavidAnderson – 1.14.11
    
    Essential WPBakery Page Builder (formerly Visual Composer) Addons: by themebon – 1.9.1
    Waiting: by Plugin Builders – 0.4.5
    WC4BP -> WooCommerce BuddyPress Integration (Premium): by ThemeKraft – 3.1.4 – Not tested with the active version of WooCommerce
    WC4BP -> Subscriptions: by ThemeKraft – 1.1.0 – Not tested with the active version of WooCommerce
    WC4BP -> BuddyPress xProfile Checkout Manager: by ThemeKraft – 1.3.0 – Not tested with the active version of WooCommerce
    WooCommerce Colors: by WooThemes – 1.0.7 – Not tested with the active version of WooCommerce
    WooCommerce PayPal Express Checkout Gateway: by WooCommerce – 1.5.5
    WooCommerce Stripe Gateway: by WooCommerce – 4.1.6
    WooCommerce Memberships: by SkyVerge – 1.10.4
    WooCommerce Social Login: by SkyVerge – 2.5.2
    WooCommerce Subscriptions: by Prospress Inc. – 2.2.21
    WooCommerce: by Automattic – 3.4.1 – 3.4.2 is available
    WP File Manager: by mndpsingh287 – 2.7
    WP Rollback: by WordImpress – 1.5
    
    ### Settings ###
    
    API Enabled: ✔
    Force SSL: ✔
    Currency: USD ($)
    Currency Position: left
    Thousand Separator: ,
    Decimal Separator: .
    Number of Decimals: 2
    Taxonomies: Product Types: course (course)
    external (external)
    grouped (grouped)
    simple (simple)
    subscription (subscription)
    variable (variable)
    variable subscription (variable-subscription)
    
    Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog)
    exclude-from-search (exclude-from-search)
    featured (featured)
    outofstock (outofstock)
    rated-1 (rated-1)
    rated-2 (rated-2)
    rated-3 (rated-3)
    rated-4 (rated-4)
    rated-5 (rated-5)
    
    ### WC Pages ###
    
    Shop base: ❌ Page not set
    Cart: #562 - /cart/
    Checkout: #9648 - /woocommerce-checkout/
    My account: #9671 - /membership/
    Terms and conditions: ❌ Page not set
    
    ### Theme ###
    
    Name: Boss. Child Theme
    Version: 2.4.3
    Author URL: http://www.buddyboss.com
    Child Theme: ✔
    Parent Theme Name: Boss.
    Parent Theme Version: 2.4.6
    Parent Theme Author URL: https://www.buddyboss.com
    WooCommerce Support: ✔
    
    ### Templates ###
    
    Overrides: –
    
    ### subscriptions ###
    
    WCS_DEBUG: ✔
    						No
    Subscriptions Mode: ✔
    						Live
    Subscriptions Template Theme Overrides: –
    Report Cache Enabled: ✔
    						Yes
    Cache Update Failures: ✔
    						0 failure
    
    bassibabes1
    Participant

    I’ve seen that this problem crops up a lot, but I can’t seem to find a solution that works…

    I have Membership Pro 2 and BuddyPress installed. I’m using the BuddyPress registration form with extra profile fields. Currently, the registration form asks for the Username and Name (display name in BP terms). Obviously, this is really confusing for new members when they’re registering so I need to remove one of these. I’ve tested it out and the WP Username is the one that seems to be used throughout the site, so it would be good just to hide/remove the BP Name. I can hide the field with CSS, but then there is an error and the form won’t submit due to the missing field.

    Do I just need to find the code to allow the form to be submitted without this required field?

    I’ve seen people use the two plugins:

    BuddyPress Usernames Only

    BP XProfile WordPress User Sync

    But I can’t see how these can work with this particular issue?

    Any help is appreciated.

    vaibhavyuvasoft187
    Participant

    <?php get_header( ‘buddypress’ ); ?>
    <!– MAIN SECTION
    ================================================ –>
    <section>
    <div id=”main”>
    <div class=”row”>
    <div class=”twelve columns”>
    <?php do_action( ‘bp_before_register_page’ ); ?>
    <div id=”register-page”>
    <form action=”” name=”signup_form” id=”signup_form” class=”standard-form custom” method=”post” enctype=”multipart/form-data”>
    <?php if ( ‘registration-disabled’ == bp_get_current_signup_step() ) : ?>
    <?php do_action( ‘template_notices’ ); ?>
    <?php do_action( ‘bp_before_registration_disabled’ ); ?>
    <p><?php _e( ‘User registration is currently not allowed.’, ‘buddypress’ ); ?></p>
    <?php do_action( ‘bp_after_registration_disabled’ ); ?>
    <?php endif; // registration-disabled signup setp ?>
    <?php if ( ‘request-details’ == bp_get_current_signup_step() ) : ?>
    <div class=”row”>
    <div class=”twelve columns”>
    <h2 class=”article-title text-center”><?php _e( ‘Create an Account’, ‘buddypress’ ); ?></h2>
    </div>
    <!–end twelve–>
    </div>
    <?php do_action( ‘template_notices’ ); ?>
    <p class=”lead”><?php _e( ‘Registering for this site is easy. Just fill in the fields below, and we\’ll get a new account set up for you in no time.’, ‘buddypress’ ); ?></p>
    <br><br>
    <?php do_action( ‘bp_before_account_details_fields’ ); ?>
    <div class=”row”>
    <div class=”register-section six columns” id=”basic-details-section”>
    <?php /***** Basic Account Details ******/ ?>
    <h4><i class=”icon icon-user”></i> <?php _e( ‘Account Details’, ‘buddypress’ ); ?></h4>
    <br>
    <label for=”signup_username”><?php _e( ‘Username’, ‘buddypress’ ); ?> <?php _e( ‘(required)’, ‘buddypress’ ); ?></label>
    <?php do_action( ‘bp_signup_username_errors’ ); ?>
    <input type=”text” name=”signup_username” id=”signup_username” value=”<?php bp_signup_username_value(); ?>” />
    <label for=”signup_email”><?php _e( ‘Email Address’, ‘buddypress’ ); ?> <?php _e( ‘(required)’, ‘buddypress’ ); ?></label>
    <?php do_action( ‘bp_signup_email_errors’ ); ?>
    <input type=”text” name=”signup_email” id=”signup_email” value=”<?php bp_signup_email_value(); ?>” />
    <label for=”signup_password”><?php _e( ‘Choose a Password’, ‘buddypress’ ); ?> <?php _e( ‘(required)’, ‘buddypress’ ); ?></label>
    <?php do_action( ‘bp_signup_password_errors’ ); ?>
    <input type=”password” name=”signup_password” id=”signup_password” value=”<?php bp_signup_password_value(); ?>” class=”password-entry” />
    <div id=”pass-strength-result”></div>
    <label for=”signup_password_confirm”><?php _e( ‘Confirm Password’, ‘buddypress’ ); ?> <?php _e( ‘(required)’, ‘buddypress’ ); ?></label>
    <?php do_action( ‘bp_signup_password_confirm_errors’ ); ?>
    <input type=”password” name=”signup_password_confirm” id=”signup_password_confirm” value=”<?php bp_signup_password_confirm_value(); ?>” class=”password-entry-confirm” />
    <br><br>
    </div>
    <!– #basic-details-section –>
    <?php do_action( ‘bp_after_account_details_fields’ ); ?>
    <?php /***** Extra Profile Details ******/ ?>
    <?php if ( bp_is_active( ‘xprofile’ ) ) : ?>
    <?php do_action( ‘bp_before_signup_profile_fields’ ); ?>
    <div class=”register-section six columns” id=”profile-details-section”>
    <h4><i class=”icon icon-comments”></i> <?php _e( ‘Profile Details’, ‘buddypress’ ); ?></h4>
    <div class=”check-group”>
    <div class=”col-md-4 col-sm-4″>
    <label for=”g1″ class=”g1″>
    <input type=”radio” name=”colorRadio” value=”first-section” id=”g1″ checked=”checked”> Algemeen
    </label>
    </div>
    <div class=”col-md-4 col-sm-4″>
    <label for=”g2″ class=”g2″>
    <input type=”radio” name=”colorRadio” value=”second-section” id=”g2″> Man
    </label>
    </div>
    <div class=”col-md-4 col-sm-4″>
    <label for=”g3″ class=”g3″>
    <input type=”radio” name=”colorRadio” value=”third-section” id=”g3″> Vrouw
    </label>
    </div>
    </div>
    <br>

    <section class=”first-section radio-section”>
    <!– <h1>Algemeen</h1> –>
    <?php /* Use the profile field loop to render input fields for the ‘base’ profile field group */ ?>
    <?php if ( bp_is_active( ‘xprofile’ ) ) : if ( bp_has_profile( array( ‘profile_group_id’ => 1, ‘fetch_field_data’ => false ) ) ) : while ( bp_profile_groups() ) : bp_the_profile_group(); ?>
    <?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?>
    <div class=”<?php if(‘selectbox’ == bp_get_the_profile_field_type() || ‘multiselectbox’ == bp_get_the_profile_field_type() ) echo ‘six’; else echo ‘twelve’;?> columns”>
    <div<?php bp_field_css_class( ‘editfield’ ); ?>>
    <?php
    $field_type = bp_xprofile_create_field_type( bp_get_the_profile_field_type() );
    $field_type->edit_field_html();

    do_action( ‘bp_custom_profile_edit_fields_pre_visibility’ );

    if ( bp_current_user_can( ‘bp_xprofile_change_field_visibility’ ) ) : ?>
    <p class=”field-visibility-settings-notoggle” id=”field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>”>
    <?php
    printf(
    __( ‘This field can be seen by: %s’, ‘buddypress’ ),
    ‘<span class=”current-visibility-level”>’ . bp_get_the_profile_field_visibility_level_label() . ‘</span>’
    );
    ?>
    </p>
    <div class=”field-visibility-settings” id=”field-visibility-settings-<?php bp_the_profile_field_id() ?>”>
    <fieldset>
    <legend><?php _e( ‘Who can see this field?’, ‘buddypress’ ) ?></legend>
    <?php bp_profile_visibility_radio_buttons() ?>
    </fieldset>
    <?php _e( ‘Close’, ‘buddypress’ ) ?>
    </div>
    <?php else : ?>
    <p class=”field-visibility-settings-notoggle” id=”field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>”>
    <?php
    printf(
    __( ‘This field can be seen by: %s’, ‘buddypress’ ),
    ‘<span class=”current-visibility-level”>’ . bp_get_the_profile_field_visibility_level_label() . ‘</span>’
    );
    ?>
    </p>
    <?php endif ?>
    <?php do_action( ‘bp_custom_profile_edit_fields’ ); ?>
    <p class=”description”><?php bp_the_profile_field_description(); ?></p>
    </div>
    </div>
    <?php endwhile; ?>
    <?php $fields_ids[]= bp_get_the_profile_field_id();?>
    <?php endwhile; endif; endif; ?>
    </section>

    <section class=”second-section radio-section”>
    <!– <h1>Man</h1> –>
    <?php if ( bp_is_active( ‘xprofile’ ) ) : if ( bp_has_profile( array( ‘profile_group_id’ => 2, ‘fetch_field_data’ => false ) ) ) : while ( bp_profile_groups() ) : bp_the_profile_group(); ?>
    <?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?>
    <div class=”<?php if(‘selectbox’ == bp_get_the_profile_field_type() || ‘multiselectbox’ == bp_get_the_profile_field_type() ) echo ‘six’; else echo ‘twelve’;?> columns”>
    <div<?php bp_field_css_class( ‘editfield’ ); ?>>
    <?php
    $field_type = bp_xprofile_create_field_type( bp_get_the_profile_field_type() );
    $field_type->edit_field_html();

    do_action( ‘bp_custom_profile_edit_fields_pre_visibility’ );

    if ( bp_current_user_can( ‘bp_xprofile_change_field_visibility’ ) ) : ?>
    <p class=”field-visibility-settings-notoggle” id=”field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>”>
    <?php
    printf(
    __( ‘This field can be seen by: %s’, ‘buddypress’ ),
    ‘<span class=”current-visibility-level”>’ . bp_get_the_profile_field_visibility_level_label() . ‘</span>’
    );
    ?>
    </p>
    <div class=”field-visibility-settings” id=”field-visibility-settings-<?php bp_the_profile_field_id() ?>”>
    <fieldset>
    <legend><?php _e( ‘Who can see this field?’, ‘buddypress’ ) ?></legend>
    <?php bp_profile_visibility_radio_buttons() ?>
    </fieldset>
    <?php _e( ‘Close’, ‘buddypress’ ) ?>
    </div>
    <?php else : ?>
    <p class=”field-visibility-settings-notoggle” id=”field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>”>
    <?php
    printf(
    __( ‘This field can be seen by: %s’, ‘buddypress’ ),
    ‘<span class=”current-visibility-level”>’ . bp_get_the_profile_field_visibility_level_label() . ‘</span>’
    );
    ?>
    </p>
    <?php endif ?>
    <?php do_action( ‘bp_custom_profile_edit_fields’ ); ?>
    <p class=”description”><?php bp_the_profile_field_description(); ?></p>
    </div>
    </div>
    <?php endwhile; ?>
    <?php $fields_ids[]= bp_get_the_profile_field_id();?>
    <?php endwhile; endif; endif; ?>
    </section>

    <section class=”third-section radio-section”>
    <!– <h1>Vrouw</h1> –>
    <?php if ( bp_is_active( ‘xprofile’ ) ) : if ( bp_has_profile( array( ‘profile_group_id’ => 3, ‘fetch_field_data’ => false ) ) ) : while ( bp_profile_groups() ) : bp_the_profile_group(); ?>
    <?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?>
    <div class=”<?php if(‘selectbox’ == bp_get_the_profile_field_type() || ‘multiselectbox’ == bp_get_the_profile_field_type() ) echo ‘six’; else echo ‘twelve’;?> columns”>
    <div<?php bp_field_css_class( ‘editfield’ ); ?>>
    <?php
    $field_type = bp_xprofile_create_field_type( bp_get_the_profile_field_type() );
    $field_type->edit_field_html();

    do_action( ‘bp_custom_profile_edit_fields_pre_visibility’ );

    if ( bp_current_user_can( ‘bp_xprofile_change_field_visibility’ ) ) : ?>
    <p class=”field-visibility-settings-notoggle” id=”field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>”>
    <?php
    printf(
    __( ‘This field can be seen by: %s’, ‘buddypress’ ),
    ‘<span class=”current-visibility-level”>’ . bp_get_the_profile_field_visibility_level_label() . ‘</span>’
    );
    ?>
    </p>
    <div class=”field-visibility-settings” id=”field-visibility-settings-<?php bp_the_profile_field_id() ?>”>
    <fieldset>
    <legend><?php _e( ‘Who can see this field?’, ‘buddypress’ ) ?></legend>
    <?php bp_profile_visibility_radio_buttons() ?>
    </fieldset>
    <?php _e( ‘Close’, ‘buddypress’ ) ?>
    </div>
    <?php else : ?>
    <p class=”field-visibility-settings-notoggle” id=”field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>”>
    <?php
    printf(
    __( ‘This field can be seen by: %s’, ‘buddypress’ ),
    ‘<span class=”current-visibility-level”>’ . bp_get_the_profile_field_visibility_level_label() . ‘</span>’
    );
    ?>
    </p>
    <?php endif ?>
    <?php do_action( ‘bp_custom_profile_edit_fields’ ); ?>
    <p class=”description”><?php bp_the_profile_field_description(); ?></p>
    </div>
    </div>
    <?php endwhile; ?>
    <?php $fields_ids[]= bp_get_the_profile_field_id();?>
    <?php endwhile; endif; endif; ?>
    </section>

    <input type=”hidden” name=”signup_profile_field_ids” id=”signup_profile_field_ids” value=”<?php echo implode(“,”,$fields_ids);?>” />
    </div>
    <!– #profile-details-section –>
    </div>
    <?php do_action( ‘bp_after_signup_profile_fields’ ); ?>
    <?php endif; ?>
    <?php if ( bp_get_blog_signup_allowed() ) : ?>
    <?php do_action( ‘bp_before_blog_details_fields’ ); ?>
    <?php /***** Blog Creation Details ******/ ?>
    <div class=”register-section” id=”blog-details-section”>
    <h4><?php _e( ‘Blog Details’, ‘buddypress’ ); ?></h4>
    <p><label for=”signup_with_blog”><input type=”checkbox” name=”signup_with_blog” id=”signup_with_blog” value=”1″<?php if ( (int) bp_get_signup_with_blog_value() ) : ?> checked=”checked”<?php endif; ?> /> <?php _e( ‘Yes, I\’d like to create a new site’, ‘buddypress’ ); ?></label></p>
    <div id=”blog-details”<?php if ( (int) bp_get_signup_with_blog_value() ) : ?>class=”show”<?php endif; ?>>
    <label for=”signup_blog_url”><?php _e( ‘Blog URL’, ‘buddypress’ ); ?> <?php _e( ‘(required)’, ‘buddypress’ ); ?></label>
    <?php do_action( ‘bp_signup_blog_url_errors’ ); ?>
    <?php if ( is_subdomain_install() ) : ?>
    http:// <input type=”text” name=”signup_blog_url” id=”signup_blog_url” value=”<?php bp_signup_blog_url_value(); ?>” /> .<?php bp_blogs_subdomain_base(); ?>
    <?php else : ?>
    <?php echo site_url(); ?>/ <input type=”text” name=”signup_blog_url” id=”signup_blog_url” value=”<?php bp_signup_blog_url_value(); ?>” />
    <?php endif; ?>
    <label for=”signup_blog_title”><?php _e( ‘Site Title’, ‘buddypress’ ); ?> <?php _e( ‘(required)’, ‘buddypress’ ); ?></label>
    <?php do_action( ‘bp_signup_blog_title_errors’ ); ?>
    <input type=”text” name=”signup_blog_title” id=”signup_blog_title” value=”<?php bp_signup_blog_title_value(); ?>” />
    <label><?php _e( ‘I would like my site to appear in search engines, and in public listings around this network.’, ‘buddypress’ ); ?>:</label>
    <?php do_action( ‘bp_signup_blog_privacy_errors’ ); ?>
    <label><input type=”radio” name=”signup_blog_privacy” id=”signup_blog_privacy_public” value=”public”<?php if ( ‘public’ == bp_get_signup_blog_privacy_value() || !bp_get_signup_blog_privacy_value() ) : ?> checked=”checked”<?php endif; ?> /> <?php _e( ‘Yes’, ‘buddypress’ ); ?></label>
    <label><input type=”radio” name=”signup_blog_privacy” id=”signup_blog_privacy_private” value=”private”<?php if ( ‘private’ == bp_get_signup_blog_privacy_value() ) : ?> checked=”checked”<?php endif; ?> /> <?php _e( ‘No’, ‘buddypress’ ); ?></label>
    </div>
    </div>
    <!– #blog-details-section –>
    <?php do_action( ‘bp_after_blog_details_fields’ ); ?>
    <?php endif; ?>
    <?php do_action( ‘bp_before_registration_submit_buttons’ ); ?>
    <div class=”submit”>
    <input type=”submit” class=”button radius pull-right” name=”signup_submit” id=”signup_submit” value=”<?php _e( ‘Complete Sign Up’, ‘buddypress’ ); ?>” />
    </div>
    <?php do_action( ‘bp_after_registration_submit_buttons’ ); ?>
    <?php wp_nonce_field( ‘bp_new_signup’ ); ?>
    <?php endif; // request-details signup step ?>
    <?php if ( ‘completed-confirmation’ == bp_get_current_signup_step() ) : ?>
    <h2 class=”article-title”><?php _e( ‘Sign Up Complete!’, ‘kleo_framework’ ); ?></h2>
    <?php do_action( ‘template_notices’ ); ?>
    <?php do_action( ‘bp_before_registration_confirmed’ ); ?>
    <?php if ( bp_registration_needs_activation() ) : ?>
    <p><?php _e( ‘You have successfully created your account! To begin using this site you will need to activate your account via the email we have just sent to your address.’, ‘buddypress’ ); ?></p>
    <?php else : ?>
    <p><?php _e( ‘You have successfully created your account! Please log in using the username and password you have just created.’, ‘buddypress’ ); ?></p>
    <?php endif; ?>
    <?php do_action( ‘bp_after_registration_confirmed’ ); ?>
    <?php endif; // completed-confirmation signup step ?>
    <?php do_action( ‘bp_custom_signup_steps’ ); ?>
    </form>
    </div>
    <?php do_action( ‘bp_after_register_page’ ); ?>
    <div class=”clearfix”></div>
    <br><br>
    </div>
    <!–end twelve–>
    </div>
    <!–end row–>
    </div>
    <!–end main–>
    </section>
    <!–END MAIN SECTION–>
    <style type=”text/css”>
    .check-group{
    width: 100%;
    margin-bottom: 70px;
    }
    .check-group .col-md-4{
    width: 20%;
    float: left;
    }
    .check-group label{
    background: none;
    padding: 8px 12px;
    border-radius: 5px;
    width: 60%;
    border:2px solid #d7b46a;
    color: #fff;
    }
    </style>
    <script type=”text/javascript”>
    jQuery(document).ready( function() {
    if ( jQuery(‘div#blog-details’).length && !jQuery(‘div#blog-details’).hasClass(‘show’) )
    jQuery(‘div#blog-details’).toggle();

    jQuery( ‘input#signup_with_blog’ ).change( function() {
    if(jQuery(this).is(‘:checked’)) {
    jQuery(‘div#blog-details’).fadeIn();
    }
    else {
    jQuery(‘div#blog-details’).fadeOut();
    }
    });
    });
    </script>
    <script type=”text/javascript”>
    // jQuery(document).ready(function(){
    // jQuery(‘input[type=”radio”]’).click(function(){
    // var inputValue = jQuery(this).attr(“value”);
    // var targetBox = jQuery(“.” + inputValue);
    // jQuery(“.radio-section”).not(targetBox).hide();
    // jQuery(targetBox).show();
    // });
    // });
    jQuery(document).ready(function(){
    jQuery(‘.second-section’).hide(‘fast’);
    jQuery(‘.third-section’).hide(‘fast’);
    jQuery(‘.first-section’).show(‘fast’);
    jQuery(‘.g1’).css({‘background’: ‘#d7b46a’, ‘color’: ‘#333’});

    jQuery(‘.g1’).click(function(){
    jQuery(‘.second-section’).hide(‘fast’);
    jQuery(‘.third-section’).hide(‘fast’);
    jQuery(‘.first-section’).show(‘fast’);
    jQuery(‘.g1’).css({‘background’: ‘#d7b46a’, ‘color’:’#333′});
    jQuery(‘.g2’).css({‘background’: ‘none’, ‘color’:’#fff’});
    jQuery(‘.g3’).css({‘background’: ‘none’, ‘color’:’#fff’});
    })
    jQuery(‘.g2’).click(function(){
    jQuery(‘.first-section’).hide(‘fast’);
    jQuery(‘.third-section’).hide(‘fast’);
    jQuery(‘.second-section’).show(‘fast’);
    jQuery(‘.g1’).css({‘background’: ‘none’, ‘color’:’#fff’});
    jQuery(‘.g2’).css({‘background’: ‘#d7b46a’, ‘color’:’#333′});
    jQuery(‘.g3’).css({‘background’: ‘none’, ‘color’:’#fff’});
    })
    jQuery(‘.g3’).click(function(){
    jQuery(‘.first-section’).hide(‘fast’);
    jQuery(‘.second-section’).hide(‘fast’);
    jQuery(‘.third-section’).show(‘fast’);
    jQuery(‘.g1’).css({‘background’: ‘none’, ‘color’:’#fff’});
    jQuery(‘.g3’).css({‘background’: ‘#d7b46a’, ‘color’:’#333′});
    jQuery(‘.g2’).css({‘background’: ‘none’, ‘color’:’#fff’});
    })
    })
    </script>
    <?php get_footer( ‘buddypress’ ); ?>

    #267803
    artempr
    Participant

    Hi. If it still an issue , I d recommend you to look at bp-xprofile-settings.php

    function bp_xprofile_get_settings_fields( $args = '' ) {
      //if u have ome custom user roles  you can simply filter here which groups to hide  
        if(!current_user_can("owner")){
            $query='5,6,4';
        }else{
            $query='1,3,4,5';
        }
    	// Parse the possible arguments.
    	$r = bp_parse_args( $args, array(
    		'user_id'                => bp_displayed_user_id(),
    		'profile_group_id'       => false,
    		'hide_empty_groups'      => false,
    		'hide_empty_fields'      => false,
    		'fetch_fields'           => true,
    		'fetch_field_data'       => false,
    		'fetch_visibility_level' => true,
    		'exclude_groups'         => $query,
    		'exclude_fields'         => false
    	), 'xprofile_get_settings_fields' );
    
    	return bp_has_profile( $r );
    }
    #266676
    beckyH
    Participant

    Hi,

    I have buddypress installed and I’m using for a company Intranet.

    To create additional fields that I need, I have installed Buddypress Xprofile Custom Fields Type and it works rather well.

    The problem is, I want to store additional info about each person that they can’t edit or see.

    I have figured out how to hide a group of fields when viewing the user’s profile by adding in some code to exclude the group, in this instance the group ID 4:

    <?php
    /**
     * BuddyPress - Members Profile Loop
     *
     * @package BuddyPress
     * @subpackage bp-legacy
     */
    
    /** This action is documented in bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php */
    do_action( 'bp_before_profile_loop_content' ); ?>
    
    <?php if ( bp_has_profile() ) : ?>
    
    	<?php while ( bp_profile_groups() ) : bp_the_profile_group(); if ( bp_get_the_profile_group_id() != '4' ) :?>
    
    		<?php if ( bp_profile_group_has_fields() ) : ?>
    
    			<?php
    
    			/** This action is documented in bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php */
    			do_action( 'bp_before_profile_field_content' ); ?>
    
    			<div class="bp-widget <?php bp_the_profile_group_slug(); ?>">
    
    				<h2><?php bp_the_profile_group_name(); ?></h2>
    
    				<table class="profile-fields">
    
    					<?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?>
    
    						<?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 endif; ?>
    
    						<?php
    
    						/**
    						 * Fires after the display of a field table row for profile data.
    						 *
    						 * @since 1.1.0
    						 */
    						do_action( 'bp_profile_field_item' ); ?>
    
    					<?php endwhile; ?>
    
    				</table>
    			</div>
    
    			<?php
    
    			/** This action is documented in bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php */
    			do_action( 'bp_after_profile_field_content' ); ?>
    
    		<?php endif; ?>
    
    	<?php endif; endwhile; ?>
    
    	<?php
    
    	/** This action is documented in bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php */
    	do_action( 'bp_profile_field_buttons' ); ?>
    
    <?php endif; ?>
    
    <?php
    
    /** This action is documented in bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php */
    do_action( 'bp_after_profile_loop_content' ); ?>
    

    What I can’t seem to figure out is how to hide the group of fields in Edit mode. So basically, at the minute when a user goes to edit the profile fields, group 4 will display.

    I believe it’s the edit file I need to edit but I’m not a coder. I learnt vb, php etc a decade ago so i get the drift but I’m playing around here and can’t quite get it work with the lack of knowledge I have.

    I have tried doing what I’ve done about but just get an error. Any ideas please?

    <?php
    /**
     * BuddyPress - Members Single Profile Edit
     *
     * @package BuddyPress
     * @subpackage bp-legacy
     */
    
    /**
     * Fires after the display of member profile edit content.
     *
     * @since 1.1.0
     */
    do_action( 'bp_before_profile_edit_content' );
    
    if ( bp_has_profile( 'profile_group_id=' . bp_get_current_profile_group_id() ) ) :
    	while ( bp_profile_groups() ) : bp_the_profile_group(); ?>
    	
    
    <form action="<?php bp_the_profile_group_edit_form_action(); ?>" method="post" id="profile-edit-form" class="standard-form <?php bp_the_profile_group_slug(); ?>">
    
    	<?php
    
    		/** This action is documented in bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php */
    		do_action( 'bp_before_profile_field_content' ); ?>
    
    		<h2><?php printf( __( "Editing '%s' Profile Group", 'buddypress' ), bp_get_the_profile_group_name() ); ?></h2>
    
    		<?php if ( bp_profile_has_multiple_groups() ) : ?>
    			<ul class="button-nav" aria-label="<?php esc_attr_e( 'Profile field groups', 'buddypress' ); ?>" role="navigation">
    
    				<?php bp_profile_group_tabs(); ?>
    
    			</ul>
    		<?php endif ;?>
    
    		<div class="clear"></div>
    
    		<?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?>
    
    			<div<?php bp_field_css_class( 'editfield' ); ?>>
    
    				<?php
    				$field_type = bp_xprofile_create_field_type( bp_get_the_profile_field_type() );
    				$field_type->edit_field_html();
    
    				/**
    				 * Fires before the display of visibility options for the field.
    				 *
    				 * @since 1.7.0
    				 */
    				do_action( 'bp_custom_profile_edit_fields_pre_visibility' );
    				?>
    
    				<?php if ( bp_current_user_can( 'bp_xprofile_change_field_visibility' ) ) : ?>
    					<p class="field-visibility-settings-toggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>">
    						<?php
    						printf(
    							__( 'This field can be seen by: %s', 'buddypress' ),
    							'<span class="current-visibility-level">' . bp_get_the_profile_field_visibility_level_label() . '</span>'
    						);
    						?>
    						<a href="#" class="visibility-toggle-link"><?php _e( 'Change', 'buddypress' ); ?></a>
    					</p>
    
    					<div class="field-visibility-settings" id="field-visibility-settings-<?php bp_the_profile_field_id() ?>">
    						<fieldset>
    							<legend><?php _e( 'Who can see this field?', 'buddypress' ) ?></legend>
    
    							<?php bp_profile_visibility_radio_buttons() ?>
    
    						</fieldset>
    						<a class="field-visibility-settings-close" href="#"><?php _e( 'Close', 'buddypress' ) ?></a>
    					</div>
    				<?php else : ?>
    					<div class="field-visibility-settings-notoggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>">
    						<?php
    						printf(
    							__( 'This field can be seen by: %s', 'buddypress' ),
    							'<span class="current-visibility-level">' . bp_get_the_profile_field_visibility_level_label() . '</span>'
    						);
    						?>
    					</div>
    				<?php endif ?>
    
    				<?php
    
    				/**
    				 * Fires after the visibility options for a field.
    				 *
    				 * @since 1.1.0
    				 */
    				do_action( 'bp_custom_profile_edit_fields' ); ?>
    
    				<p class="description"><?php bp_the_profile_field_description(); ?></p>
    			</div>
    
    		<?php endwhile; ?>
    
    	<?php
    
    	/** This action is documented in bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php */
    	do_action( 'bp_after_profile_field_content' ); ?>
    
    	<div class="submit">
    		<input type="submit" name="profile-group-edit-submit" id="profile-group-edit-submit" value="<?php esc_attr_e( 'Save Changes', 'buddypress' ); ?> " />
    	</div>
    
    	<input type="hidden" name="field_ids" id="field_ids" value="<?php bp_the_profile_field_ids(); ?>" />
    
    	<?php wp_nonce_field( 'bp_xprofile_edit' ); ?>
    
    </form>
    
    <?php endwhile; endif; ?>
    
    <?php
    
    /**
     * Fires after the display of member profile edit content.
     *
     * @since 1.1.0
     */
    do_action( 'bp_after_profile_edit_content' ); ?>
    

    Thank you

    metadataconsulting
    Participant

    Hi good folks at BB,

    Q1) How do i go about adding TabIndex to input fields for TEXTAREA or CHECKBOX ? This works for TEXT input types but not TEXTAREA or CHECKBOX.

    $tabno = 0; //number of fields from above
    while ( bp_profile_fields() ) : bp_the_profile_field();
    $tabno++;
    ?>
    <div<?php bp_field_css_class( ‘editfield’ ); ?>>
    <?php
    $field_type = bp_xprofile_create_field_type( bp_get_the_profile_field_type() );
    //$field_type->edit_field_html();

    //this does not work for TEXTAREA or CHECKBOX
    $field_type->edit_field_html(array(“tabindex”=>”$tabno”));

    //Q2 Why do I need this line? How can I hide these ids?
    <input type=”hidden” name=”signup_profile_field_ids” id=”signup_profile_field_ids” value=”<?php bp_the_profile_field_ids(); ?>” />

    Strothi
    Participant

    Hey guys,

    first of all, awesome forum! I’ve already solved so many of my issues simply by reading the many helpful answers – hence never had the need to post anything myself, but now I’m a bit stuck.

    Here’s what I wanted to do: Put a new profile group in a separate bp profile menu tab and make it visible to both, logged in as well as logged out users. Now, it works perfectly fine, except for the fact that logged out users for some reason get to see my personal profile group under my custom tab instead of the new profile group – which is displayed correctly for me as well as other logged in users.

    Here’s my code:

    /**
    BP Profile Tab Visibility
    */
    
    function bpfr_hide_top_nav() {	
    	
    	if( !is_user_logged_in() ) {	
    
    // bp topnav items to hide	
    		bp_core_remove_nav_item( 'activity' );			
    		bp_core_remove_nav_item( 'friends' );
    		bp_core_remove_nav_item( 'groups' );
    		bp_core_remove_nav_item( 'forums' );
    		bp_core_remove_nav_item( 'media' );
    		bp_core_remove_nav_item( 'docs' );
    		bp_core_remove_nav_item( 'location' );
    	
    
    //bp subnav (my activities, my groups, etc)
    		bp_core_remove_subnav_item( 'activity', 'activity' );
    		bp_core_remove_subnav_item( 'activity', 'friends' ); 
    		bp_core_remove_subnav_item( 'activity', 'favorites' );
    		bp_core_remove_subnav_item( 'activity', 'groups' );
    		bp_core_remove_subnav_item( 'activity', 'mentions' );
    		bp_core_remove_subnav_item( 'activity', 'media' );
    		bp_core_remove_subnav_item( 'activity', 'docs' );
    		bp_core_remove_subnav_item( 'activity', 'comments' );
    
    	}
    }
    add_action( 'bp_ready', 'bpfr_hide_top_nav', 10 );
    
    /**
    BP Tab Order Profile and Tab Rename
    */
    
    function bpex_primary_nav_tabs_position() {
    	buddypress()->members->nav->edit_nav( array( 'position' => 2,	), 'activity' 		);
    	buddypress()->members->nav->edit_nav( array( 'position' => 1, 	), 'profile' 		); 
    	buddypress()->members->nav->edit_nav( array( 'position' => 3,	), 'messages' 	  	);
        buddypress()->members->nav->edit_nav( array( 'position' => 4, 	), 'notifications'	); 
    	buddypress()->members->nav->edit_nav( array( 'position' => 5,	), 'friends' 	  	);
    	buddypress()->members->nav->edit_nav( array( 'position' => 6,	), 'groups' 		);
    	buddypress()->members->nav->edit_nav( array( 'position' => 7, 	), 'forums' 		);
        buddypress()->members->nav->edit_nav( array( 'position' => 8, 	), 'criticalreview'	);
    	buddypress()->members->nav->edit_nav( array( 'position' => 9, 	), 'docs' 		    );
        buddypress()->members->nav->edit_nav( array( 'position' => 10, 	), 'media'	     	);
        buddypress()->members->nav->edit_nav( array( 'position' => 11, 	), 'location'     	);
        buddypress()->members->nav->edit_nav( array( 'position' => 12, 	), 'orders'	     	);
        buddypress()->members->nav->edit_nav( array( 'position' => 13, 	), 'settings' 		);
    }
    add_action( 'bp_setup_nav', 'bpex_primary_nav_tabs_position', 999 );
    
    /**
    Put Critical Review Profile Group in BP Tab
    */
    
    function buddydev_modifyy_user_profile_tab() {
    
    bp_core_new_nav_item( array(
    'name'	=> 'Critical Review',
    'slug'	=> 'criticalreview',
    'screen_function'	=> 'buddydev_screen_profile_data',
    'default_subnav_slug' => 'criticalreview-sub',
    'show_for_displayed_user' => true,
    ));
    
    }
    add_action( 'bp_setup_nav', 'buddydev_modifyy_user_profile_tab', 8 );
    
    function buddydev_screen_profile_data() {
    //filter loop
    add_filter( 'bp_after_has_profile_parse_args', 'buddydev_filter_args_for_profile_group' );
    //load loop
    add_action( 'bp_template_content', 'buddydev_show_profile_group_data');
    
    bp_core_load_template( 'members/single/plugins');
    }
    
    function buddydev_filter_args_for_profile_group( $args ) {
    ///CHANGE IT
    $args['profile_group_id'] = '6'; //Your Profile Group ID Here
    
    return $args;
    }
    //Load the loop 
    function buddydev_show_profile_group_data() {
    $profileslug = bp_get_profile_slug();
    // if ( bp_is_my_profile() ) :
    // echo "Edit under Profile";
    // endif;
    bp_get_template_part( 'members/single/profile/profile-loop' );
    }
    
    function hide_profile_group( $grpid ) {
    if ( is_user_logged_in() && !bp_is_profile_edit() ) {
    $myfield = xprofile_get_field_data( 'Critical Review' );
    $grpid['exclude_groups'] = '6';
    }
    return $grpid;
    }
    add_filter( 'bp_after_has_profile_parse_args', 'hide_profile_group' );
    

    A few comments:

    Most of the essential code is based on this threat. I am not really a coder myself, but usually I understand what the functions are doing.

    For now I commented `// if ( bp_is_my_profile() ) :
    // echo “Edit under Profile”;
    // endif;` out, because if I leave it in, for some reason then also logged-in users only see the personal profile group instead of the Critical Review one?!

    Also, I’m not entirely sure about the use of the last function and its use / relevance, because it doesn’t seem to affect anything. This might however have to do with the fact that in order to avoid duplication of the Critical Review profile group under the actual profile tab, I’ve hidden the profile group via CSS.

    Finally, I’m running the latest WP and BP installs and you can have a look at the described behavior here. Interestingly, as you can see in this instance, the profile fields are actually adjusted to my CSS for the Critical Review profiles group – but the actual content doesn’t show correctly.

    Now, if any of you could help me out, I would highly appreciate it!

    Thank you so much in advance! 🙂

    #263397
    john.horning
    Participant

    Thanks for the quick response, but doesn’t seem to be working for me. I created the template overload of profile-loop.php and stored it in wp-content/themes/buddyboss-child/buddypress/bp-templates/bp-legacy/buddypress/members/single/profile. I’ve pasted the entire file below after modification.

    I can’t find it now, but there was a thread somewhere that indicated that the following line needed to be changed in bp-xprofile-template.php so was wondering what you thought of that.
    $hide_empty_fields_default = ( ! is_network_admin() && ! is_admin() && ! bp_is_user_profile_edit() && ! bp_is_register_page() );

    Anyway, here’s my profile-loop.php:
    `

    john.horning
    Participant

    When a user is viewing their own profile, I would like to show them all fields, regardless of whether they have values or not. I don’t want to force them to enter values, but I do want to make it obvious which fields are empty.

    So I understand that hiding fields is done in this file: bp-xprofile-template.php. Can someone tell me how to modify it so no fields are hidden when users are viewing their own profiles? I realize it’s poor practice to modify plugin files so am also open to other suggestions on how to accomplish this.

    buckyb
    Participant

    Hi, I’m using the plugin BuddyPress Admin Only Profile Fields to hide certain xprofile fields, I have quite a few, when viewing the admin EDIT (front view) page, it shows a blank white screen. I cannot figure out whats wrong with the site, if anyone can help I’d greatly appreciate it.

    #260277
    danbp
    Moderator

    It relate to this filter bp_get_profile_field_data

    This example will hide tabs and fields to all except admin

    function bpfr_hide_profile_field_group( $retval ) {
    	if ( bp_is_active( 'xprofile' ) ) :	
    	
    	// hide profile group/field to all except admin	
    	if ( !is_super_admin() ) {		
    		//exlude fields, separated by comma
    		$retval['exclude_fields'] = '1';  
    		//exlude groups, separated by comma
    		$retval['exclude_groups'] = '3'; 			
    	} 
    	return $retval;		
    	
    	endif;
    }
    add_filter( 'bp_after_has_profile_parse_args', 'bpfr_hide_profile_field_group' );

    These tricks hide the tab content, not the tab itself. (it seems that it doesn’t work for groups at the moment…i asked devs for information) Use CSS display:none to hide the tab or consider this plugin.

    #260209
    Jek-fdrv
    Participant

    wp v4.6.1
    bp v2.7.0
    Theme: Twenty Sixteen
    Cant provide link, it is on my local.
    I am web developer.

    Hello, I would like to ask you about xprofile fields for users.
    I have add 2 profile fields groups, with fields.
    Right now I am wondering if it is possible to hide them from:
    Single profile page. From show tab and from EDIT tab.
    From dashboard profile edit page.
    From custom profile fields.
    From tabs every where.

    I have tried to use this code:
    function bpfr_hide_profile_field_group( $retval ) {
    $retval[‘exclude_groups’] = ‘0,1,2’;
    return $retval;
    }
    It hide fields only from show on single profile page but not from edit.
    Thank you very much.
    Very appreciate your help.

    #258444
    giilour
    Participant

    Is there a way to filter out some xprofile fields to be displayed on the members profile page? Some fields I want to hide as default.

    Jeremy Pry
    Participant

    Under certain circumstances, there is an infinite loop inside the bp_legacy_theme_new_activity_comment() function. Specifically, when all of the secondary_item_id fields are zero, the $parent_id will continually be set to zero. An infinite loop ensues and eventually the script will time out. This causes new activity items to not display until the page is refreshed, as mentioned here: https://buddypress.org/support/topic/activity-comments-post-blank-until-refresh/.

    This error happens when attempting to add a comment to a group post. I believe this is a similar problem as the one expressed here: https://buddypress.org/support/topic/activity-comments-post-blank-until-refresh/

    For information:

    • WordPress 4.5.3
    • BuddyPress 2.6.1.1
    • Single site install in web root
    • There are indeed other plugins activated on this site. The full list is below. This site is for a client, and I’m unsure of which plugins can be safely deactivated to test.
    • We’re using a customized theme, but I have tested with the TwentySixteen theme and found the same results.
    • The core BuddyPress files have not been modified to my knowledge.
    • The site is hosted on Page.ly, but I can reproduce the problems in a local VVV install
    • The live site is http://www.lifeofdad.com/

    I believe that this may be a problem inside BuddyPress itself, as the function with the infinite loop is part of BuddyPress. The Javascript that makes the Ajax request is part of the BuddyPress Wall plugin, but from what I can tell the problem is in the aforementioned bp_legacy_theme_new_activity_comment() function.

    My specific concern is this loop:

    
    	// Load the new activity item into the $activities_template global.
    	bp_has_activities( 'display_comments=stream&hide_spam=false&show_hidden=true&include=' . $comment_id );
    
    	// Swap the current comment with the activity item we just loaded.
    	if ( isset( $activities_template->activities[0] ) ) {
    		$activities_template->activity = new stdClass();
    		$activities_template->activity->id              = $activities_template->activities[0]->item_id;
    		$activities_template->activity->current_comment = $activities_template->activities[0];
    
    		// Because the whole tree has not been loaded, we manually
    		// determine depth.
    		$depth = 1;
    		$parent_id = (int) $activities_template->activities[0]->secondary_item_id;
    		while ( $parent_id !== (int) $activities_template->activities[0]->item_id ) {
    			$depth++;
    			$p_obj = new BP_Activity_Activity( $parent_id );
    			$parent_id = (int) $p_obj->secondary_item_id;
    		}
    		$activities_template->activity->current_comment->depth = $depth;
    	}
    

    I’ve run XDebug locally to inspect the items in the loop as it is running. If some of the raw variable data is required, I can provide that.

    I have tried making some changes to the code in this loop to prevent the infinite loop from occurring. While successful in that endeavor with a few tweaks, the result is that the comment sent back through the Ajax response is the wrong comment, and a page refresh is still needed.

    I considered filing a bug in Trac, but I wasn’t certain whether something else could possibly be interfering.

    
    +--------------------------------------+--------+-----------+---------+
    | name                                 | status | update    | version |
    +--------------------------------------+--------+-----------+---------+
    | akismet                              | active | none      | 3.1.11  |
    | all-in-one-seo-pack                  | active | available | 2.3.7   |
    | appbuddy                             | active | available | 2.0.7   |
    | appcamera                            | active | available | 2.0.0   |
    | appfbconnect                         | active | none      | 2.3.0   |
    | apppresser                           | active | none      | 2.5.0   |
    | apppush                              | active | available | 2.1.0   |
    | appshare                             | active | none      | 2.1.0   |
    | appswiper                            | active | available | 2.2.1   |
    | bp-profile-search                    | active | none      | 4.5.2   |
    | buddypress                           | active | none      | 2.6.1.1 |
    | buddypress-activity-plus             | active | none      | 1.6.4   |
    | bp-moderation                        | active | none      | 0.1.7   |
    | buddypress-nocaptcha-register-box    | active | none      | 1.1.3   |
    | buddypress-toolbar                   | active | none      | 1.6.0   |
    | buddypress-wall                      | active | none      | 0.9.4   |
    | buddypress-xprofile-image-field      | active | none      | 2.0.1   |
    | category-posts                       | active | none      | 4.6.1   |
    | contact-form-7                       | active | none      | 4.4.2   |
    | contact-form-7-to-database-extension | active | none      | 2.10.20 |
    | cubell-themes-functionality          | active | none      | 3.1     |
    | envato-wordpress-toolkit             | active | none      | 1.7.3   |
    | hashbuddy                            | active | none      | 1.5.2   |
    | login-with-ajax                      | active | none      | 3.1.6   |
    | mailchimp-for-wp                     | active | none      | 3.1.11  |
    | nav-menu-roles                       | active | none      | 1.8.2   |
    | nextend-facebook-connect             | active | none      | 1.5.9   |
    | buddypress-media                     | active | none      | 4.0.4   |
    | vine-embed                           | active | none      | 0.2     |
    | wds-lod-automatic-friends            | active | none      | 0.1.0   |
    | wds-lod-base                         | active | none      | 0.1.0   |
    | wds-lod-bp                           | active | none      | 0.1.0   |
    | wds-lod-post-types                   | active | none      | 0.1.0   |
    | wds-lod-widgets                      | active | none      | 0.1.0   |
    | wordpress-importer                   | active | none      | 0.6.1   |
    +--------------------------------------+--------+-----------+---------+
    
    Masoud
    Participant

    @shanebp
    hi. tnx for answer and patience. got 5 more minutes? 🙂
    i read and worked on what you said. and if i want to be honest, i could’t do anything special unfortunately.
    now, i want to ask your opinion about this idea:
    i’ve come up with the idea of hiding that field. (not email field), how?
    with the use of if condition… (if it’s not empty show it. if it has data, hide it)!
    ——-
    i’ve created a custom-meta with this code in theme functions:

    add_action( 'personal_options_update', 'my_save_extra_profile_fields' );
    add_action( 'edit_user_profile_update', 'my_save_extra_profile_fields' );
    function my_save_extra_profile_fields( $user_id ) {
    if ( !current_user_can( 'edit_user', $user_id ) )
    	return false;
    /* Copy and paste this line for additional fields. */
    add_user_meta( $user_id, ‘person_relation’, 30318 );
    update_usermeta( absint( $user_id ), 'person_relation', wp_kses_post( $_POST['person_relation'] ) );
    update_user_meta( $user_id, 'person_relation', $_POST['person_relation'] );
    }

    and used it in my buddypress signup form, to get data from users. ok?
    after what you said, i went to edit.php (copy to my theme buddypress folder…)
    and added these codes. but it seems that they do not recieve/send data at all.
    it looks like they are empty!! 😐
    after <?php at the start,
    i added :

    global $user, $user_id;
    $person_relation = get_the_author_meta( 'person_relation', $user->ID );
    $user_id = get_current_user_id();

    and in the <form> ,
    i added this piece of code (not working)
    then copied and changed the “save changes button”.
    so there is 2 buttons. one is for my-custom-meta, and the other is for buddypress form.
    buddypress edit page
    if user writes the name and click save. the box/button, all should gone. and i have to see the data in Users admin panel.
    but nothing is getting save… and i dont know where am i doing it wrong

    <?php if( $person_relation == '' ): ?>
    <tr>
    <th><label for="person_relation">Invitor's Name</label></th>
    <td>
    <input type="text" name="person_relation" id="person_relation" value="<?php update_usermeta( $user_id, 'person_relation', $_POST['person_relation'] ); ?>" class="regular-text" /><br />
    <span class="description">Please enter your invitor's name.</span>
    </td>
    </tr>
    <input type="hidden" id="userID" value="<?php echo $user_id ?>"/>
    <div class="submit">
    <input type="submit" name="profile-group-edit-submit" id="profile-group-edit-submit" value="<?php esc_attr_e( 'Save Name', 'buddypress' ); ?> " />
    </div>
    <input type="hidden" name="person_relation" id="person_relation" value="<?php update_usermeta( $user_id, 'person_relation', $_POST['person_relation'] ); ?>" />
    <?php add_action( 'personal_options_update', 'my_save_extra_profile_fields' ); ?>
    <?php add_action( 'edit_user_profile_update', 'my_save_extra_profile_fields' ); ?>
    <?php do_action( 'xprofile_profile_field_data_updated'); ?>
    <?php endif; ?>

    so sorry for long description. tnx for help.
    any suggestions do you have?

    #253525
    danbp
    Moderator

    Perhaps this can help you to go further.

    For point 2, maybe this snippet can do the job. Give it a try ! Add it to bp-custom.php

    function custom_display_xprofile_fields() {
    
    // single field item
    if ( $data = bp_get_profile_field_data( 'field=Industry' ) ) : // change field name to yours
    	echo '<div class="industry">'. xprofile_get_field_data( 'Industry', bp_displayed_user_id() ) .'</div>';
    endif;
    }
    add_action( 'bp_after_profile_loop_content' , 'custom_display_xprofile_fields' );
    #252926
    Jeff
    Participant

    I have a chance to use a third-party plugin for allowing users to “Like” activity entries. I need to first disable or hide the existing “Like” functionality. Is there a setting for this?

    Plugins:
    Akismet (3.1.10) by Automattic
    Awesome Support (3.2.9) by ThemeAvenue
    bbPress (2.5.8) by The bbPress Community
    BuddyBoss Inbox (1.0.4) by BuddyBoss
    BuddyBoss Media (3.1.9) by BuddyBoss
    BuddyBoss Reply by Email (1.0.2) by BuddyBoss
    BuddyBoss Wall (1.2.7) by BuddyBoss
    BuddyPress (2.5.2) by The BuddyPress Community
    BuddyPress Edit Activity (1.0.7) by BuddyBoss
    BuddyPress Xprofile Custom Fields Type (2.4.6) by donmik
    Gravity Forms (1.9.18) by rocketgenius
    Gravity Forms Help Scout Add-On (1.3) by rocketgenius
    Gravity Forms Polls Add-On (3.0) by Rocketgenius
    Gravity Forms Survey Add-On (3.0) by Rocketgenius
    Gravity Forms Trello Add-On (1.0) by rocketgenius
    Gravity Forms User Registration Add-On (3.3) by rocketgenius
    Invite Anyone (1.3.10) by Boone Gorges
    Like Button Voting & Rating (2.1.9) by LikeBtn
    List Plugins (1.4.4) by SedLex
    Maintenance (2.7.1) by fruitfulcode
    Orbit (1.6) by TrueThemes
    POWr Social Feed (1.4) by POWr.io
    POWr Social Media Icons (1.4) by POWr.io
    Remove Dashboard Access (1.1.3) by Drew Jaynes (DrewAPicture)
    Subscribe To Comments (2.3) by Mark Jaquith
    TinyMCE Advanced (4.3.8) by Andrew Ozz
    User Role Editor (4.25.1) by Vladimir Garagulya
    WordPress Social Stream (1.5.15) by Lee Chestnutt
    WPBakery Visual Composer (4.11.2) by Michael M – WPBakery.com

    Thanks!

    #251812
    carson7634
    Participant

    Hello all,

    I’ve been creeping around these forums for a few days, but I’m unable to find a post that explains what I’m looking for in any decent detail.

    I’m trying to remove one of the xprofile fields from the edit page. My end goal is to limit what fields may be modified by the user, based on their membership level using s2membership. I feel if I can figure out how to hide one field, I’ll be able to go from there.

    Now I have found a few posts describing this same action, but the responses seem very vague. What I’ve been trying to do is modify the edit.php file in the “wp-content/plugins/buddypress/bp-themes/bp-default/members/single/profile” directory. I realize that modifying the core files is not the best practice, and this will be replaced with the next buddypress update, but I also have not found a detailed explanation on the proper way to edit these files, so I’m sticking with this for the moment just to see if I can get it working.

    I see there is a while loop in this file, and it looks like it iterates for each element in an array containing all of the profile fields. Each iteration grabs the fields type as a string, and compares it to a list of valid options. When a match is found, it performs some html/php magic, and adds a field on the screen to be modified. (php and html are new to me. I am familiar with c++, java, and c#)

    modified snippet from file:

    
    <?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?>		
    
         <div<?php bp_field_css_class( 'editfield' ); ?>>
    
              <?php if ( 'textbox' == bp_get_the_profile_field_type() ) : ?>
    
                  *html/php magic*
    
              <?php endif; ?>
         </div>
    
    <?php endwhile; ?>
    

    No matter what edits I make to this file, it does not seem to change anything.

    Any information would be great, and I appreciate your time. Thank you.

    #249689
    calvinorenda
    Participant

    After adding the fields you want using xprofile, go to your regi page. If you are using google chrome, right click on the multiline box and inspect

    you should find out the the id of the visual/text box something similar this ‘wp-field_664-editor-tools’ (yours should be a bit different cos field number is different)

    you should also find out the id of the mce panel using the same method

    After that you should be able to add the custom css to your theme stylesheet.
    Example (hiding the item using css):
    #wp-field_664-editor-tools {display:none;}

    You may need to double check on the edit profile page. if it still appears there, you can use the same method to hide it.
    Hope this helps.

Viewing 25 results - 1 through 25 (of 129 total)
Skip to toolbar