Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to REMOVE “This field can be seen by:”


  • chris19731973
    Participant

    @chris19731973

    Hi,
    Please how to remove “This field can be seen by: All Members/Everyone/…” in the Registration page & Edit Profile page ?
    Thank you …

Viewing 15 replies - 1 through 15 (of 15 total)

  • chris19731973
    Participant

    @chris19731973

    For information, I have installed and activated 2 plugins :
    1) BP Profile Search
    2) BuddyPress Xprofile Custom Field Types


    Venutius
    Moderator

    @venutius

    Which BP Template are you using? Youcan see this in Settings>>BuddyPress>>Options.


    chris19731973
    Participant

    @chris19731973

    in Settings>>BuddyPress>>Options, I use “BuddyPress Legacy” BP Template …


    Venutius
    Moderator

    @venutius

    Then you can overload the edit.php and ‘register.php` files and remove that attribute.

    get ftp access to your site and location wp-content/plugins/buddypress/bp-templates/bp-legacy/members/register.php
    wp-content/plugins/buddypress/bp-templates/bp-legacy/members/single/profile/edit.php

    in these files locate and remove:

    				<?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() ?>"><span id="<?php bp_the_profile_field_input_name(); ?>-2">
    						<?php
    						printf(
    							__( 'This field can be seen by: %s', 'buddypress' ),
    							'<span class="current-visibility-level">' . bp_get_the_profile_field_visibility_level_label() . '</span>'
    						);
    						?>
    						</span>
    						<button type="button" class="visibility-toggle-link" aria-describedby="<?php bp_the_profile_field_input_name(); ?>-2" aria-expanded="false"><?php _ex( 'Change', 'Change profile field visibility level', 'buddypress' ); ?></button>
    					</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>
    						<button type="button" class="field-visibility-settings-close"><?php _e( 'Close', 'buddypress' ) ?></button>
    					</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 ?>

    Then place these modified files in `wp-content/themes/your-child-theme/buddypress/members/register.php’ and
    `wp-content/themes/your-child-theme/buddypress/members/single/profile/edit.php’


    Venutius
    Moderator

    @venutius

    Just a note, I’ve not tested this, but give it a try, it’s possible that some variation will be required.


    chris19731973
    Participant

    @chris19731973

    Now, I can read the message below when visitors choose “Register” :

    Create an Account
    Parse error: syntax error, unexpected ‘<‘ in C:\xampp\htdocs\buddypressdivi2\wp-content\themes\Divi\buddypress\members\register.php on line 189

    I removed the “Visibility” codes and the new code of the register.php file is :

    Line 183 : */
    Line 184 : do_action( ‘bp_custom_profile_edit_fields_pre_visibility’ );
    Line 185 :
    Line 186 :
    Line 187 :
    Line 188 : <?php
    Line 189 :
    Line 190 :
    Line 191 : /**


    chris19731973
    Participant

    @chris19731973

    ` <?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?>

    <div<?php bp_field_css_class( ‘editfield’ ); ?>>
    <fieldset>

    <?php
    $field_type = bp_xprofile_create_field_type( bp_get_the_profile_field_type() );
    $field_type->edit_field_html();

    /**
    * Fires before the display of the visibility options for xprofile fields.
    *
    * @since 1.7.0
    */
    do_action( ‘bp_custom_profile_edit_fields_pre_visibility’ );

    <?php

    /**
    * Fires after the display of the visibility options for xprofile fields.
    *
    * @since 1.1.0
    */
    do_action( ‘bp_custom_profile_edit_fields’ ); ?>

    </fieldset>
    </div>

    <?php endwhile; ?>`


    chris19731973
    Participant

    @chris19731973

    OK, thank you …


    Venutius
    Moderator

    @venutius

    It looks like you have an extra <?php in your code, so you’ve deleted too much. another opton would be to put the code back and just hide it using style=”display: none;”.

    So for example you could change this:

    <span class="current-visibility-level">' . bp_get_the_profile_field_visibility_level_label() . '</span>'

    to

    <span class="current-visibility-level" style="display:none;">' . bp_get_the_profile_field_visibility_level_label() . '</span>'

    and add that to all the elements you want to hide.


    chris19731973
    Participant

    @chris19731973

    It doesn’t work for me …

    What has been changed ? see below :

    ‘<span class=”current-visibility-level”>’ has been replaced by
    <span class=”current-visibility-level” style=”display:none;”>’ .
    in the 2 files below :

    wp-content/themes/your-child-theme/buddypress/members/register.php’
    

    wp-content/themes/your-child-theme/buddypress/members/single/profile/edit.php’


    chris19731973
    Participant

    @chris19731973

    From another site, they add the code below to CSS files (but I don’t know the names of these files) :

    https://alkaweb.ticksy.com/ticket/1389627/

    That’s coming from BuddyPress, CSS will do the job:

    .field-visibility-settings-toggle{display:none!important;}

    Please do you know the files (in buddypress or in the Theme folder?) ?


    chris19731973
    Participant

    @chris19731973

    In the site below, they copy the code to style.css file …

    https://buddypress.org/support/topic/how-to-remove-this-field-can-be-seen-by/
    You could download a plugin like this: https://wordpress.org/extend/plugins/safecss/ and add these lines of css to your style sheet, or If you have a created a child theme, you can just add these lines to your style.css file

    .field-visibility-settings-toggle {
    display:none;
    }
    .field-visibility-settings-notoggle {
    display:none;
    }

    I don’t have the style.css file in my Theme but these 2 files instead :
    editor-style.css
    theme-customizer-controls-styles

    Please do you know which CSS files need to be added or modified ?


    chris19731973
    Participant

    @chris19731973

    {RESOLVED} : How to REMOVE “This field can be seen by:” ?

    In the folder of the Theme, add the code below at the end of the file called style.css :
    For me in Localhost : C:\xampp\htdocs\buddypressdivi2\wp-content\themes\Divi\Style.css

    .field-visibility-settings-toggle{display:none!important;}

    For information, the visibility of “This field can be seen by: All Members/Everyone/…” will be removed in both the Registration page & Edit Profile page ….


    chris19731973
    Participant

    @chris19731973

    It’s my first time on this BP Forum, please how to add “RESOLVED” ?


    chris19731973
    Participant

    @chris19731973

    {RESOLVED} : How to REMOVE “This field can be seen by:” ?

    In the folder of the Theme, add the code below at the end of the file called style.css :
    For me in Localhost : C:\xampp\htdocs\buddypressdivi2\wp-content\themes\Divi\Style.css

    .field-visibility-settings-toggle{display:none!important;}

    In Users/Profile Fields of WP-Admin, set the fields like below :
    Visibility = Everyone
    and Allow members to override

    For information, the visibility of “This field can be seen by: All Members/Everyone/…” will be removed in both the Registration page & Edit Profile page … except for the fields (Required) Name …

    It’s my first time on this BP Forum, please how to add “RESOLVED” ?
    Thank you …

Viewing 15 replies - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.
Skip to toolbar