-
Masoud started the topic [Resolved] is it possible to let users set a field only limited times? in the forum How-to & Troubleshooting 8 years, 5 months ago
hi.
i was wondering if it is possible to let the users, set their data on some special field only once.
let’s say email for example.1) in the buddypress registration form they set a valid email.
2) get activation email , and enter to profile
3) change their email (and activate the second email)
4) they want to change their email again. but they…[Read more] -
Masoud replied to the topic register page problem in the forum How-to & Troubleshooting 8 years, 5 months ago
solved it.
hopefully someone from wordpres.org helped me.
here is the link for anyone in the future faced the same problem as me.
wordpress.org pagethe answer was:
If you want to add some user meta info in user database while registration you need to use “user_register” filter like below code:Add code in your themes function.php file
add_action(…
[Read more] -
Masoud started the topic register page problem in the forum How-to & Troubleshooting 8 years, 5 months ago
hi.
i made an extra field on buddypress registration form.<tr>
[Read more]
<th><label for="person_relation">Inviter's Name</label></th>
<td>
<input type="text" name="person_relation" id="person_relation" value="<?php echo esc_attr( get_the_author_meta( 'person_relation', $user->ID ) ); ?>" class="regular-text" /><br />
<span class="description">Please enter… -
Masoud replied to the topic how to create a new field in profile fields? in the forum How-to & Troubleshooting 8 years, 5 months ago
i’ve managed to create a extra field by ID, and this is the function to save it.
it’s name is “person_relation”.add_action( 'personal_options_update', 'my_save_extra_profile_fields' );
[Read more]
add_action( 'edit_user_profile_update', 'my_save_extra_profile_fields' );
function my_save_extra_profile_fields( $user_id ) {
if ( !current_user_can(… -
Masoud started the topic how protect a profile field ? in the forum How-to & Troubleshooting 8 years, 5 months ago
hi.
i have 2 questions.
1) how can i create a new profile field?
2) how to protect it from the users so they can only set that field’s data once.
and cannot change it after that.
just like the username field in registration form, which u cannot edit it or change it after it has been set!how can i do this?
any suggestion?tnxx for help.
-
Masoud started the topic how to create a new field in profile fields? in the forum How-to & Troubleshooting 8 years, 5 months ago
hi.
i am using latest version of wordpress and buddypress.
——
i want to create a new field by code, in group1 (which will be appeared on signup page) so when user is signing up,
see that box and fill it, and cannot edit it after the account creation (for example just like USERNAME!)
(you set it once, and it cannot be edited after…)and…[Read more]
-
Masoud replied to the topic [Resolved] how hide tab only for user? not remove/disable in the forum How-to & Troubleshooting 8 years, 5 months ago
@sharmavishal
hi. thanks for the answer, i got it. -
Masoud replied to the topic [Resolved] how hide tab only for user? not remove/disable in the forum How-to & Troubleshooting 8 years, 5 months ago
@danbp
do i need to update the codes in my theme manually, everytime you roll an update for the plugin?
because as it’s said in many places, when i create a folder named “Buddypress”
in my theme, it will override the original. correct?for example. now it’s version 2.5.3 and i copied the general.php from plugin in my theme’s buddypress folder.
so…[Read more] -
Masoud replied to the topic [Resolved] how hide tab only for user? not remove/disable in the forum How-to & Troubleshooting 8 years, 5 months ago
@shanebp
hi, the function worked very well.
and thanks for your help. -
Masoud replied to the topic [Resolved] how hide tab only for user? not remove/disable in the forum How-to & Troubleshooting 8 years, 5 months ago
@danbp
thanks for your complete explanation. but there is not such a file members/single/settings/general.php in my socialchef theme.
and yes, i do have a buddypress folder in my socialchef theme.
so i created the path. and copied the general.php from buddypress plugin files to the destination folder.
and did the changes as i want.
thanks a lot. -
Masoud replied to the topic [Resolved] how hide tab only for user? not remove/disable in the forum How-to & Troubleshooting 8 years, 5 months ago
@danbp
first of all i have to thank you for your quick answer and great support.
i am very satisfied with the support of this plugin. you guys are great.
thank you very much.
—-
1 & 2 ) the function worked great, but the “private message” button in profile still remains!
i mean if a user can not send message so there is no need to show them that…[Read more] -
Masoud started the topic [Resolved] how hide tab only for user? not remove/disable in the forum How-to & Troubleshooting 8 years, 5 months ago
hi.
i want to hide some tabs only for non-admins.
for example “Compose”
underMessage > Compose.
in bp-messages/classes/class-bp-component.php lines:199 & 287.
it’s possible to add a conditional if().
<strong>if(current_user_can(administrator))</strong>
[Read more]
{
$sub_nav[] = array(
'name'=> __( 'Compose', 'buddypress' ),
'slug'=> 'compose',
'parent_url'=>… -
Masoud replied to the topic help in writing a function? hooks? actions? in the forum How-to & Troubleshooting 8 years, 5 months ago
@shanebp
thank you very much.
the code above run with no eror.
—–
UPDATE:
i put it in my theme functions.php. and it works.
by mistake i was thinking that i have to put it in bp-custom.php to make it work.
but it has to be in FUNCTIONS.PHP of your THEME. -
Masoud replied to the topic help in writing a function? hooks? actions? in the forum How-to & Troubleshooting 8 years, 5 months ago
@shanebp
no still not working. but thank you for your help and notice. -
Masoud replied to the topic help in writing a function? hooks? actions? in the forum How-to & Troubleshooting 8 years, 5 months ago
@shanebp
many thanks to you for your help.
but unfortunately this code you said, does not work.
and still redirected to wp-login.php
i put the code in bp-custom.phpwhat other codes do you suggest please?
thanks for your notice. -
Masoud replied to the topic help in writing a function? hooks? actions? in the forum How-to & Troubleshooting 8 years, 5 months ago
@shanebp
oops!
i have to use “root”
instead of “redirect” 😐
because root points for not-logged-in-users.
and redirect points for successfully-logged in users!
sorry for that mistake.
now i’ve set
root = $redirect=get_home_url ( int $blog_id = null, string $path = '/login', string|null $scheme = null );
but error again! 🙁correction:
i want to…[Read more] -
Masoud replied to the topic help in writing a function? hooks? actions? in the forum How-to & Troubleshooting 8 years, 5 months ago
hi. tnx for your answer.
tnx for mention the use of ‘code’. i will do it in future.
in these past 2days i’m trying to do what you said in different ways. but i keep seeing error.
so i come back here.
sorry i dont know a lot about coding.. 🙁
i’ve tried many codes. some of these codes:first:
function masoud_core_no_access( $r…
[Read more] -
Masoud started the topic help in writing a function? hooks? actions? in the forum How-to & Troubleshooting 8 years, 5 months ago
hi.
i want to know how can i write a function in bp-custom.php
i know this :
function thisandthat()
{
}
add_action();
or add_filter();
but i dont know when should i use filter, and when or where should i use action.
—-
i dont want to edit core codes…
i want to write a function to call bpnoaccess action from
bp_core_no_access
but i dont even…[Read more] -
Masoud's profile was updated 8 years, 6 months ago
@masoud1111
Active 4 years ago