Search Results for 'profile fields'
-
AuthorSearch Results
-
September 13, 2014 at 3:54 pm #193476
In reply to: [Resolved] Customise register page
danbp
ParticipantThe field NAME in the field group BASE is required. This group is used for the registration page to work. As you already know, it’s also this group who allows you to show custom fields on the registration page.
The NAME field in BuddyPress is intended to receive first and last name and replace the two original fields (first name, last name) coming with WordPress.That said, you can hide this field to users, but you can’t give them the choice to show/hide it.
The above snippet will hide the field NAME to all visitors/members, but not to site admin and the concerned profile.
function bpfr_make_name_members_only( $retval ) { //hold all of our info global $bp; // is xprofile component active ? if ( bp_is_active( 'xprofile' ) ) // The user ID of the currently logged in user $current_user_id = (int) trim($bp->loggedin_user->id); // The author that we are currently viewing $author_id = (int) trim($bp->displayed_user->id); // user can see only his name && admin can see everyone if ($current_user_id !== $author_id && !current_user_can('delete_others_pages') ) { $retval['exclude_fields'] = '1'; } return $retval; } add_filter( 'bp_after_has_profile_parse_args', 'bpfr_make_name_members_only' );Add this to your child-theme functions.php or to bp-custom.php
September 12, 2014 at 5:55 pm #192577In reply to: [Resolved] Need a plugin to require xprofile fields
samdobrow
ParticipantGood points.
Initially, I’d be glad to have a check to require completion of all the xprofile fields then automatically (approve) change the user role to allow more access.
Another option might to be to grant access to the xprofile fields while in a pending status, then manually approve when the profile is completed. Currently, I have an intercept in the login routine that logs users out if their status is pending and redirects them to a “Pending Approval” page. Perhaps I could leave them logged in and force the redirect to the xprofile page. Any ideas on how to form the correct url to the xprofile page? Will all xprofile tabs be accessible under the single url?
Thoughts? Ideas?
September 12, 2014 at 11:29 am #192184In reply to: [Resolved] Need a plugin to require xprofile fields
colabsadmin
ParticipantHave you asked the BP Private plugin devs? Seems that you could edit their code to do a check of each required field. They’re probably only checking if a person is logged in.
if (!bp_is_my_profile() && !bp_custom_get_member_list_xprofile_data('Company') && !bp_custom_get_member_list_xprofile_data('Location'))The unfortunate part of this is that check would have to be done on every page causing unnecessary processing time to every page load, unless you set a cookie or a single flag in the db. But then what happens if a user removes the information in one of the fields at a later date.
September 12, 2014 at 9:00 am #192180In reply to: Can BuddyPress Do This?
danbp
Participantyes, you can have all this !
Profiles are public, but you can set them as “members only”.
And each member can choose the field visibility. Also it is very easy to let some fields public, allow to members or only to users friends.You can also hide comments with your conditionnals.
Discover here all buddypress features and read a bit the codex to see all things you can realize with buddypress.
September 12, 2014 at 1:00 am #192165schorsch2
ParticipantHi,
I have had the same problem and now, I have found a solution which works with my theme: just declare the variable $data (or whatever name you give it) as static before calling bp_get_member_profile_data or bp_member_profile_data like this:<?php static $data = 'bla'; ?> <?php do_action( 'bp_directory_members_item' ); ?> <?php /*** * If you want to show specific profile fields here you can, * but it'll add an extra query for each member in the loop * (only one regardless of the number of fields you show): * * bp_member_profile_data( 'field=the field name' ); */ $data = bp_get_member_profile_data( 'field=Taetigkeit' ); if( $data != '' ) echo $data; ?>September 11, 2014 at 2:35 pm #192058In reply to: Changing Name's default visibility
danbp
Participantnot the exact answer, but a way how to do it.
This snippet will make the NAME field hidden to all except for adminsfunction bp_define_hidden_fields( $hidden_fields, $displayed_user_id, $current_user_id ) { //if not admin or if not the profile of the current user if ( !is_super_admin( $current_user_id) && ($displayed_user_id != $current_user_id) ) { //add name field ( id = 1 ) to the hidden fields $hidden_fields[] = 1; } return $hidden_fields; } add_filter('bp_xprofile_get_hidden_fields_for_user','bp_define_hidden_fields', 10 ,3 );Reference:
bp-xprofile/bp-xprofile-classes.phpSeptember 8, 2014 at 11:02 am #190923In reply to: [Resolved] Re-install Buddypress Tables
christicehurst
ParticipantBelow is the errors that gave out after installing Buddypress
WordPress database error: [Table 'christic_database.wp_bp_xprofile_data' doesn't exist] SELECT id, user_id, field_id, value, last_updated FROM wp_bp_xprofile_data WHERE field_id = 1 AND user_id IN (1) WordPress database error: [Table 'christic_database.wp_bp_xprofile_fields' doesn't exist] SELECT * FROM wp_bp_xprofile_fields WHERE id = 1 WordPress database error: [Table 'christic_database.wp_bp_xprofile_fields' doesn't exist] SELECT type FROM wp_bp_xprofile_fields WHERE id = 1 WordPress database error: [Table 'christic_database.wp_bp_xprofile_fields' doesn't exist] SELECT id FROM wp_bp_xprofile_fields WHERE id = 1 Warning: Cannot modify header information - headers already sent by (output started at /home/christic/public_html/wp-content/plugins/ubermenu/core/UberMenuWalkerCore.class.php:227) in /home/christic/public_html/wp-includes/pluggable.php on line 1173 WordPress database error: [Table 'christic_database.wp_bp_user_blogs' doesn't exist] SELECT COUNT(*) FROM wp_bp_user_blogs WordPress database error: [Table 'christic_database.wp_bp_user_blogs' doesn't exist] DELETE FROM wp_bp_user_blogs WHERE 1=1 Notice: Trying to get property of non-object in /home/christic/public_html/wp-content/plugins/buddypress/bp-members/bp-members-admin.php on line 829 Notice: Trying to get property of non-object in /home/christic/public_html/wp-content/plugins/buddypress/bp-members/bp-members-admin.php on line 829 WordPress database error: [Table 'christic_database.wp_bp_user_blogs' doesn't exist] SELECT COUNT(id) FROM wp_bp_user_blogs WHERE user_id = 1 AND blog_id = 1 WordPress database error: [Table 'christic_database.wp_bp_user_blogs' doesn't exist] INSERT INTO wp_bp_user_blogs ( user_id, blog_id ) VALUES ( 1, 1 ) WordPress database error: [Table 'christic_database.wp_bp_user_blogs_blogmeta' doesn't exist] SELECT blog_id, meta_key, meta_value FROM wp_bp_user_blogs_blogmeta WHERE blog_id IN (1) ORDER BY id ASC WordPress database error: [Table 'christic_database.wp_bp_user_blogs_blogmeta' doesn't exist] SELECT id FROM wp_bp_user_blogs_blogmeta WHERE meta_key = 'url' AND blog_id = 1 WordPress database error: [Table 'christic_database.wp_bp_user_blogs_blogmeta' doesn't exist] INSERT INTO <code>wp_bp_user_blogs_blogmeta</code> (<code>blog_id</code>,<code>meta_key</code>,<code>meta_value</code>) VALUES (1,'url','http://www.christicehurst.me') WordPress database error: [Table 'christic_database.wp_bp_user_blogs_blogmeta' doesn't exist] SELECT id FROM wp_bp_user_blogs_blogmeta WHERE meta_key = 'name' AND blog_id = 1 WordPress database error: [Table 'christic_database.wp_bp_user_blogs_blogmeta' doesn't exist] INSERT INTO <code>wp_bp_user_blogs_blogmeta</code> (<code>blog_id</code>,<code>meta_key</code>,<code>meta_value</code>) VALUES (1,'name','Chris Ticehurst') WordPress database error: [Table 'christic_database.wp_bp_user_blogs_blogmeta' doesn't exist] SELECT id FROM wp_bp_user_blogs_blogmeta WHERE meta_key = 'description' AND blog_id = 1 WordPress database error: [Table 'christic_database.wp_bp_user_blogs_blogmeta' doesn't exist] INSERT INTO <code>wp_bp_user_blogs_blogmeta</code> (<code>blog_id</code>,<code>meta_key</code>,<code>meta_value</code>) VALUES (1,'description','Creative Writer cat') WordPress database error: [Table 'christic_database.wp_bp_user_blogs_blogmeta' doesn't exist] SELECT id FROM wp_bp_user_blogs_blogmeta WHERE meta_key = 'last_activity' AND blog_id = 1 WordPress database error: [Table 'christic_database.wp_bp_user_blogs_blogmeta' doesn't exist] INSERT INTO <code>wp_bp_user_blogs_blogmeta</code> (<code>blog_id</code>,<code>meta_key</code>,<code>meta_value</code>) VALUES (1,'last_activity','2014-09-08 10:59:55') WordPress database error: [Table 'christic_database.wp_bp_user_blogs_blogmeta' doesn't exist] SELECT id FROM wp_bp_user_blogs_blogmeta WHERE meta_key = 'close_comments_for_old_posts' AND blog_id = 1 WordPress database error: [Table 'christic_database.wp_bp_user_blogs_blogmeta' doesn't exist] INSERT INTO <code>wp_bp_user_blogs_blogmeta</code> (<code>blog_id</code>,<code>meta_key</code>,<code>meta_value</code>) VALUES (1,'close_comments_for_old_posts','') WordPress database error: [Table 'christic_database.wp_bp_user_blogs_blogmeta' doesn't exist] SELECT id FROM wp_bp_user_blogs_blogmeta WHERE meta_key = 'close_comments_days_old' AND blog_id = 1 WordPress database error: [Table 'christic_database.wp_bp_user_blogs_blogmeta' doesn't exist] INSERT INTO <code>wp_bp_user_blogs_blogmeta</code> (<code>blog_id</code>,<code>meta_key</code>,<code>meta_value</code>) VALUES (1,'close_comments_days_old','14') WordPress database error: [Table 'christic_database.wp_bp_user_blogs_blogmeta' doesn't exist] SELECT id FROM wp_bp_user_blogs_blogmeta WHERE meta_key = 'thread_comments_depth' AND blog_id = 1 WordPress database error: [Table 'christic_database.wp_bp_user_blogs_blogmeta' doesn't exist] INSERT INTO <code>wp_bp_user_blogs_blogmeta</code> (<code>blog_id</code>,<code>meta_key</code>,<code>meta_value</code>) VALUES (1,'thread_comments_depth','5')Below is the errors from two other plugins
Strict Standards: Declaration of UberMenuWalkerCore::start_lvl() should be compatible with Walker_Nav_Menu::start_lvl(&$output, $depth = 0, $args = Array) in /home/christic/public_html/wp-content/plugins/ubermenu/core/UberMenuWalkerCore.class.php on line 227 Strict Standards: Declaration of UberMenuWalkerCore::start_el() should be compatible with Walker_Nav_Menu::start_el(&$output, $item, $depth = 0, $args = Array, $id = 0) in /home/christic/public_html/wp-content/plugins/ubermenu/core/UberMenuWalkerCore.class.php on line 227 Strict Standards: Declaration of UberMenuWalkerCore::end_el() should be compatible with Walker_Nav_Menu::end_el(&$output, $item, $depth = 0, $args = Array) in /home/christic/public_html/wp-content/plugins/ubermenu/core/UberMenuWalkerCore.class.php on line 227 Strict Standards: Declaration of UberMenuWalkerEdit::start_lvl() should be compatible with Walker_Nav_Menu::start_lvl(&$output, $depth = 0, $args = Array) in /home/christic/public_html/wp-content/plugins/ubermenu/core/UberMenuWalkerCore.class.php on line 401 Strict Standards: Declaration of UberMenuWalkerEdit::end_lvl() should be compatible with Walker_Nav_Menu::end_lvl(&$output, $depth = 0, $args = Array) in /home/christic/public_html/wp-content/plugins/ubermenu/core/UberMenuWalkerCore.class.php on line 401 Strict Standards: Declaration of UberMenuWalkerEdit::start_el() should be compatible with Walker_Nav_Menu::start_el(&$output, $item, $depth = 0, $args = Array, $id = 0) in /home/christic/public_html/wp-content/plugins/ubermenu/core/UberMenuWalkerCore.class.php on line 401 Notice: Undefined index: ctype in /home/christic/public_html/wp-content/plugins/mycred/addons/banking/services/mycred-bank-service-interest.php on line 575 Notice: Undefined index: user_id in /home/christic/public_html/wp-content/plugins/mycred/addons/banking/services/mycred-bank-service-interest.php on line 576September 5, 2014 at 8:59 pm #189703ChiefAlchemist
Participant=> re: “Note that you need to add the correct id(s) for exclude_fields.”
Thanks shanebp. But is this the only way? I mean, I can’t do mucking with the code every time the client wants something new? Can I?
=> re: …/buddypress-xprofile-custom-fields-type/
“Add new visibility setting “Nobody”. Hide the field to all members.”
So this means, I presume that custom visibility is possible. Yes?
That said, I want to use standard fields, but I want to create the list via code, and not have to do it manually. Not possible? Mind you, it could be cause I’m new to BP but I’m trying to where / how the profile definitions are stored. I presume it’s an array, or close. So I want to do that but with code.
Thanks again
September 5, 2014 at 8:09 pm #189699shanebp
ModeratorI wouldn’t rely on messing with visibility settings.
To make a profile field only editable by admins, do this in bp-custom.php or a plugin:// only admins can edit the Skills field function chief_hide_profile_fields( $retval ) { if( is_super_admin () ) return $retval; if( bp_is_profile_edit() || bp_is_register_page() ) $retval['exclude_fields'] = '3'; //profile field ID's separated by comma return $retval; } add_filter( 'bp_after_has_profile_parse_args', 'chief_hide_profile_fields' );Note that you need to add the correct id(s) for exclude_fields.
And that ‘ || bp_is_register_page() ‘ keeps the field(s) off the register page – which you may not need to do.Re how to create profile fields in code, there a couple of ways to do it depending on the kind of field and how it will be used.
Take a look at these plugins for more info:
https://wordpress.org/plugins/buddypress-xprofile-custom-fields-type/
https://wordpress.org/plugins/buddypress-xprofile-image-field/September 4, 2014 at 11:00 am #189600In reply to: Extended Profiles / Can't edit the fields
Cartographer
ParticipantHi @danbp
Thank you very much for your response. I really appreciate it!
I think that I understand your points and I will wait for the next update.
My only comment here it that under “My profile fields visibility settings” maybe it would be nice to see the data next to the profile fields (not edit them just see them).
Thank you again 🙂
September 4, 2014 at 10:52 am #189599In reply to: Extended Profiles / Can't edit the fields
danbp
ParticipantIt is not an issue, it is intended so !
The logged user’s profile tab comes with 3 sub menus:
– View (public)
– Edit (private)
– Change avatar (private)On the main navigation of the member, you have at least
– Settings with 3 sub nav items:
– account credential (email, password)
– notifications
– field visibility settingsAnd if component is activated:
– Friends
– Groups
– ForumI agree that this Setting is confusing, at least, because those labels should indicate My Friends, My Groups, My Forums and My profile fields visibility settings, which is too long i grant you. 😉
FYI: such distinction wern’t really possible untill now in the original english version.
But the upcomming BP 2.1 brings some better context disambiguation just to improve such situation.To solve this today, you can:
1) create a translation file and modify the wording (but, as said, without disambiguation)
2) use a child theme and hardcode the text you want into the template file (best approach)
3) wait a few days for 2.1 to use the first optionSeptember 4, 2014 at 9:34 am #189583In reply to: Extended Profiles / Can't edit the fields
Cartographer
ParticipantI found this:
1) If you go through Settings and then Profile you are neither able to edit your profile nor to even see the infos (e.g. your display name)
http://i57.tinypic.com/2i6gvf5.png
2) If you go through Profile and then Edit you can edit your profile as it should
http://i61.tinypic.com/2rpv2gk.png
Well it does make sense but wouldn’t be great if you could at least see the info/fields using the method 1?
Regards
September 3, 2014 at 8:59 pm #189562In reply to: [Resolved] Registration form Field Error
danbp
ParticipantI don’t understand why you obstinatly want to write bios on wordpress (inactive when BP is activated) when you can do that with xprofile !
On the register page you have a single line text area field. Why don’t you use a multiline area for doing this ?
field type = Multi-line Text Area.
Entered text will then appear on user’s profile !The function you want to use cannot work, as it contain errors.
Sorry to tell, but I think you have to learn some php and buddypress handling before going to reinvent the wheel or making things you don’t really understand.
Some good reads here, and many others on the forum.
September 3, 2014 at 6:03 pm #189549In reply to: Multi select field no array?
danbp
ParticipantIf you want your user to set their profile, you must activate the xprofile component first.
You must also have a component page called by default Members
And a page for activation and another for registering.Then you must create some profile fields
Dashboard > users > profile fieldsAt this stage, which is the default process, you have nothing to know about array’s or code. All this is done within in a user friendly interface.
Sorry to detail such things – and probably knowed & done by you, but topics are also read by many other people.
You have an issue with multilines text areas ? OK
– do you use a custom theme or a third party theme ?
– are you on a local install ?
– have you other js malfunction elsewhere on your site ?
– have you tested with another browser ?Anyway, i guess you have to debug by deactivate all plugins but BP on the 2014 theme and retest the text area.
September 3, 2014 at 4:46 pm #189540In reply to: Multi select field no array?
ahalle
ParticipantI want the users to edit your own profile.
If the user is currently trying to save his entry in multiple select box, only in the last entry is saved, because the values are not passed in an array. Exactly the same problem at the register page.However, when I try from the backend multiple typed select and save the changes to take effect. Since this there passed as an array.
Now the question is how do I get it out that the multi-select are passed as array fields in the frontend?
September 3, 2014 at 1:19 am #189015shanebp
Moderatortry this in bp-custom.php.
You’ll have to get the ids of the fields you want to exclude on the register pagefunction register_hide_profile_fields( $retval ) { if( bp_is_register_page() ) $retval['exclude_fields'] = '3'; //field ID's separated by comma return $retval; } add_filter( 'bp_after_has_profile_parse_args', 'register_hide_profile_fields' );September 2, 2014 at 3:49 pm #188992In reply to: Extended Profile Deletes Base Profile "Display Name"
Sokrates
ParticipantHi, Just in case it’s of use….
I’m a bit of a BP newb, and I’m using a fresh install of WP 3.9.2 and BP 2.0.1
I’m using a Gravity form as a registration form with the GravityForms User Registration add-on to register BuddyPress users.
As a newb, I have been experimenting a lot with the XProfile fields, and also noticed that at some stage of the proceedings, I had made a change that resulted in the same problem as in the first post – the WordPress last name value was deleted and the firstname field was set to the nicename when the update profile button was pressed.
I had changed the primary field in the XProfile fields from “Name”.
Replacing the primary field as Name, and mapping the “full name” field from the Gravity form to this field in the Gravity User Registration add-on screen seems to solve it for me
September 1, 2014 at 3:36 pm #188874DarkPsy
ParticipantIt’s one of those I just have to grind it out I guess. I’m not worried at all about the PHP Notices, that’s fine. The absolutely amazing behavior where the current_avatar function stops working even on a clean install is spooky. I’ll post something if I do make a break through , which seems unlikely right now.
Workaround: bbp_current_user_avatar fetches the gravtar link associated with an email.
At signup I have another custom field which forces the user to upload an avatar and then I replace all avatar references to the user defined profile image.You could do this with custom fields or a plugin like ‘Buddypress upload avatar ajax’ and then just retrieve the value from the $user.
Anyway you won’t have a website which relies solely on gravatars to begin with.
Until then I’ll stick to this, thanks again Dan for your patience. Cheers!
August 31, 2014 at 8:52 am #188803In reply to: Undisplay some Fields required in Reg.Process
danbp
ParticipantAugust 28, 2014 at 12:26 am #188607In reply to: display email in member directory
rthomasTechnology
ParticipantThat’s not it. I’m in members-loop.php. That (as I understand it) is the file that controls what people see when they go to the default members directory in BuddyPress (the page that shows you everyones icon, their name and when they were last active). I want to add the users email addresses to this screen. At one point I found a line of code and pasted it between:
<div class=”item”>
<div class=”item-title”>
“><?php bp_member_name(); ?><?php if ( bp_get_member_latest_update() ) : ?>
<span class=”update”> <?php bp_displayed_user_email(); ?></span>
<?php endif; ?>
</div>
and
<?php do_action( ‘bp_directory_members_item’ ); ?>
<?php
/***
* If you want to show specific profile fields here you can,
* but it’ll add an extra query for each member in the loop
* (only one regardless of the number of fields you show):
*
* bp_member_profile_data( ‘field=email email’ );
*/?>
</div>which made the email addresses show directly under the names of the site members. I can’t find that code again.
Thanks
RandyAugust 26, 2014 at 1:13 pm #188504In reply to: [Resolved] Nobody visibility
danbp
ParticipantAnother snippet, more accurate with the suggested way above. Snippet goes into bp-custom or functions.php
The field/field group is only shown to site admins. A small bug in the current BP version(.0 -> 2.0.2) prevent of completely remove the group tab from the edit screen. Bug is fixed and this will work with BP 2.1.
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'] = '60'; //exlude groups, separated by comma - this may work with BP 2.1 $retval['exclude_groups'] = '7'; } return $retval; endif; } add_filter( 'bp_after_has_profile_parse_args', 'bpfr_hide_profile_field_group' );August 26, 2014 at 11:44 am #188500In reply to: [Resolved] Nobody visibility
danbp
Participantoh crossposting ! haven’t seen henry’s answer.
nobody visibility doesn’t exist. This setting is called “only me“. This means that only the member can see this field – and the site admins. Such fields are not for site admins, but for the members !
I don’t really understand what is not working for you, as what you’re looking for doesn’t exist in BuddyPress. Sorry if i’m misunderstanding you.
When you create such a field visibility, you should also set “Enforce the default visibility for all members“, so the member cannot modify it later on his profile settings.
Little weird side effect, when a “only me” field is used and member A wrote hello, this word becames clickabke, by default. When member B write also hello, it becames also clickable. And if A or B clcik on Hello, it shows a list of all members who wrote the same word. In this case A and B !
Not really confidential, isn’t it ? The solution is to remove the clickable link.
Here’s a snippet which let you do that selectively.function my_xprofile_filter_link_profile_data( $field_value, $field_type = 'textbox' ) { // Access the field you are going to display value. global $field; // In this array you write the ids of the fields you want to hide the link. $excluded_field_ids = array(2,9,54); // field ID separated by comma // If the id of this $field is in the array, we return the value only and not the link. if (in_array($field->id, $excluded_field_ids)) return $field_value; if ( 'datebox' == $field_type ) return $field_value; if ( !strpos( $field_value, ',' ) && ( count( explode( ' ', $field_value ) ) > 5 ) ) return $field_value; $values = explode( ',', $field_value ); if ( !empty( $values ) ) { foreach ( (array) $values as $value ) { $value = trim( $value ); // If the value is a URL, skip it and just make it clickable. if ( preg_match( '@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?)@', $value ) ) { $new_values[] = make_clickable( $value ); // Is not clickable } else { // More than 5 spaces if ( count( explode( ' ', $value ) ) > 5 ) { $new_values[] = $value; // Less than 5 spaces } else { $search_url = add_query_arg( array( 's' => urlencode( $value ) ), bp_get_members_directory_permalink() ); $new_values[] = '<a href="' . $search_url . '" rel="nofollow">' . $value . '</a>'; } } } $values = implode( ', ', $new_values ); } return $values; } /** * We remove the buddypress filter and add our custom filter. */ function remove_xprofile_links() { // Remove the old filter. remove_filter( 'bp_get_the_profile_field_value', 'xprofile_filter_link_profile_data', 9, 2 ); // Add your custom filter. add_filter( 'bp_get_the_profile_field_value', 'my_xprofile_filter_link_profile_data', 9, 2); } add_action('bp_setup_globals', 'remove_xprofile_links');August 26, 2014 at 11:12 am #188499In reply to: [Resolved] Nobody visibility
Henry Wright
ModeratorI think the field visibility settings are applicable to the member who is performing the setting.
The suggested way to do what you want would be to make your notes profile field hidden to all non-admin members.
The first step would be to create /wp-content/themes/your-theme/buddypress/members/single/profile/edit.php inside your theme.
You can copy the contents of edit.php from:
bp-templates/bp-legacy/buddypress/members/single/profile/edit.php
Then you need to modify edit.php. In edit.php, find
<?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?>and add the following immediately after it:if ( ! current_user_can( 'manage_options' ) && ( bp_get_the_profile_field_name() === 'notes' ) ) continue;Note: I’m assuming your field name is notes
August 24, 2014 at 12:42 pm #188358Jencina
ParticipantSorry, not all is well.
I edit in my custom “register.php” , but I can’t see anything. This is the code of my register custom page:
<?php global $bp; if(empty($bp->signup->step)) $bp->signup->step=’request-details’; ?> <form action="” name=”signup_form” id=”signup_form” class=”standard-form” 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() ) : ?> <?php do_action( 'template_notices' ); ?> <p><?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> <?php do_action( 'bp_before_account_details_fields' ); ?> <div class="register-section" id="basic-details-section"> <?php /***** Basic Account Details ******/ ?> <h4><?php _e( 'PRUEBA', 'buddypress' ); ?></h4> <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="" /> <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 do_action( 'bp_account_details_fields' ); ?> </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" id="profile-details-section"> <h4><?php _e( 'Profile Details', 'buddypress' ); ?></h4> <?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="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-toggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>"> <?php printf( __( 'This field can be seen by: <span class="current-visibility-level">%s</span>', 'buddypress' ), bp_get_the_profile_field_visibility_level_label() ) ?> <a href="#" class="visibility-toggle-link"><?php _ex( 'Change', 'Change profile field visibility level', '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 : ?> <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: <span class="current-visibility-level">%s</span>', 'buddypress' ), bp_get_the_profile_field_visibility_level_label() ) ?> </p> <?php endif ?> <?php do_action( 'bp_custom_profile_edit_fields' ); ?> <p class="description"><?php bp_the_profile_field_description(); ?></p> </div> <?php endwhile; ?> <input type="hidden" name="signup_profile_field_ids" id="signup_profile_field_ids" value="<?php bp_the_profile_group_field_ids(); ?>" /> <?php endwhile; endif; endif; ?> <?php do_action( 'bp_signup_profile_fields' ); ?> </div><!-- #profile-details-section --> <?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><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' ); ?></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 home_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(); ?>" /> <span class="label"><?php _e( 'I would like my site to appear in search engines, and in public listings around this network.', 'buddypress' ); ?>:</span> <?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> <?php do_action( 'bp_blog_details_fields' ); ?> </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" name="signup_submit" id="signup_submit" value="<?php esc_attr_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() ) : ?> <?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><!-- #buddypress -->August 24, 2014 at 8:07 am #188351danbp
ParticipantHi @hardeepasrani,
xProfile field manipulation is a such common question on this forum. 🙄 Did you searched before asking ?
But codex first !
Here a topic where you can find how this works and can be done.
https://buddypress.org/support/topic/how-to-add-fields-from-xprofile-fields-groups-created-by-me/ -
AuthorSearch Results