Replies
Hi,
i found the solution, maybe that help someone.
I create a function to catch non alpha characteres
/** * Verifie si une chaine est alphabetique * * @param $string * * @return bool */ function is_alpha($string) { // On cherche tt les caractères autre que [A-z] preg_match("/([^A-Za-z\s])/", $string, $result); // si on trouve des caractère autre que A-z if ( ! empty($result)) { return false; } return true; }
I create my custom error messages
add_action('bp_signup_validate', function () { $bp = buddypress(); $firstname_field_post = $_POST['yoostart_signup_firstname']; $lastname_field_post = $_POST['yoostart_signup_lastname']; if ( ! is_alpha($firstname_field_post)) { $bp->signup->errors['yoostart_signup_firstname'] = 'Le prenom ne doit comporter que des caracteres alphabétique'; } if ( ! is_alpha($lastname_field_post)) { $bp->signup->errors['yoostart_signup_lastname'] = 'Le nom ne doit comporter que des caracteres alphabétique'; } } );
and i show them on register-form.php
<!-- CUSTOM AHMED --> <div class="yoostart_name_details"> <?php if (buddypress()->signup->errors['yoostart_signup_lastname']) { echo buddypress()->signup->errors['yoostart_signup_lastname']; } ?> <div class="lastname_field"> <input type="text" name="yoostart_signup_lastname" id="yoostart_signup_lastname" value="<?= get_input('yoostart_signup_lastname') ?>" placeholder="Nom" required> </div> <?php if (buddypress()->signup->errors['yoostart_signup_firstname']) { echo buddypress()->signup->errors['yoostart_signup_firstname']; } ?> <div class="firstname_field"> <input type="text" name="yoostart_signup_firstname" id="yoostart_signup_firstname" value="<?= get_input('yoostart_signup_firstname') ?>" placeholder="Prénom" required> </div> </div> <!-- CUSTOM AHMED -->
- Ahmed on May 9, 2020 at 12:53 pm in reply to: [Resolved] Error when trying to get member type #29655
Hi Brajesh,
that’s work with bp_init.
Thank you.Regards
Ahmed Hi Brajesh,
Thanks for your help, the team of ultimate membership pro sended me the hook (ump_on_register_action), I will do that, thank you.Regards
Ahmed- This reply was modified 4 years, 10 months ago by Ahmed.
Hi Brajesh,
Sorry for my bad english, I’m from France 🙂
My question is about membership levels (paidmembership pro) , on registration i automatically assign member type ENTREPRENEUR (with Buddypress member type pro) to membership level PREMIUM, for exemple. And i would like to prevent others member type to sélect this membership level after registration.Regards
Ahmed.Hi Brajesh,
I disable changing member type after registration for all members.Hi Brajesh,
thank you for your response.- This reply was modified 6 years, 8 months ago by Ahmed.
- Ahmed on August 20, 2017 at 2:46 pm in reply to: Recent Visitors For BuddyPress Profile notifictaions issues #10356
hi Brajesh,
The current strategy of sending email/notification on new visit is good, but just one email/notification, at this time users are notified every 5-10 seconds when other users visit their profile. In the end they receive 5-6 emails for just one visit.
I may be incorrectly set the plugin. Hi Brajesh,
Great, thank you 🙂Ahmed
- Ahmed on August 1, 2017 at 10:56 pm in reply to: [Resolved] bp-activity-comment-notifier translation #10145
Hi Brajesh,
it works, that my fault, i haven’t selected charset utf-8.
Sorry - Ahmed on August 1, 2017 at 8:52 pm in reply to: [Resolved] remove activity delete button text #10144
hello Ravi,
Thank youAhmed