Forum Replies Created
-
AuthorPosts
-
toddz70Member
Using separate fields for front-end and back-end would be very hard to manage. My site already has 30 fields, so i’d need 60?
Please just implement this as another checkbox within each Field. It’d be so much easier to manage.
December 27, 2012 at 10:57 pm in reply to: Filter Hook to modify field content (options in a select menu) #2721toddz70Member@umbercode — Nope, I did not come up with anything on my own, and never heard back from the developer about it. Thanks for the idea.. maybe i’ll give it a shot.
toddz70MemberAlso, there is no way to target the Description of the Captcha field either.
toddz70Member@coji — If you’re still looking for a solution to this, you can probably do it using a HOOK. I did something similar, and posted it here –>
toddz70Member@bostondave – did you ever find a solution to this?
toddz70Member@mca – That’s a totally different topic that this thread, i think you should ask it in a different post in this forum, with a more accurate title. You’ll be more likely to get the help you need.
toddz70Member@mca – The form i’m using is a REGISTRATION form, which creates a new User in wordpress. It sounds to me like a form that allows an existing user to change his role would need to be a totally different form – a Profile Edit form, not a Registration form, since that’s what you’re really trying to do – edit his role.
toddz70MemberHmm it works for me. I got it from here –> https://developers.google.com/recaptcha/docs/customization . I have it in JS in the header.php file.
toddz70MemberAdd this JavaScript to your theme’s header.php file
var RecaptchaOptions = {
theme : 'white' //white, clean, red, blackglass
};and just set the value for THEME to whichever you want ( white, clean, red, or blackglass )
toddz70MemberI also had the same problem, and like cailloux, the solution in #1809 worked. However, should we not be concerned that this solution:
1) REMOVES a level of security, by disabling the nonce check (whatever that really means.. I honestly don’t know much about nonces yet)
2) EDITS THE CORE code of the plugin, so any subsequent updates will erase the change, requiring us to re-implement it.If setting the nonce to False is indeed a legit solution, perhaps a future release of the plugin will at least put this setting in the admin UI, so we don’t need to edit core code.
toddz70MemberI solved this for myself with some custom jQuery, added to the wp-admin.
In FUNCTIONS.PHP ….
function my_script() {
if(is_admin()){
wp_enqueue_script('custom_admin_script', get_bloginfo('template_url').'/js/admin.js', array('jquery'));
}
}
my_script();
in JS/ADMIN.JS …..
jQuery(document).ready(function(){
jQuery('input.um_input').each(function() {
var class_text;
class_text = jQuery(this).attr("class");
class_text = class_text.replace("validate[required]","");
class_text = class_text.replace("validate[required,","validate[");
//console.log(class_text); //test
jQuery(this).attr("class",class_text);
});
});
It’d be great if this were implemented as built-in feature of the plugin though.. as another checkbox in each Field, so the user can set whether the field is required in Admin too, or just front-end.
toddz70MemberI was able to accomplish this using a Filter hook. Here’s what i did, if it helps anyone.
My Scenario — I have two different Registration forms, one for Students, and another for Schools. The Students reg form has a field with “my-school” as the meta-key. My function checks for the existence of that field in the submitted data from the form, and if found, we know the submission is from the Student form; otherwise it’s from the School form. So in my functions.php :
add_filter('user_meta_pre_user_register', 'tz_registration_role');
function tz_registration_role($userData){
if( isset($userData['my-school'])){
// registration for Student
$userData['role'] = 'student';
} else {
// registration for School
$userData['role'] = 'school';
}
return $userData;
}This lets me assign the Role dynamically, based on which Registration form was used.
- This reply was modified 12 years, 2 months ago by toddz70. Reason: cleaned up the code
toddz70MemberHi.
On March 9, 2012, khaledsaikat said we can use a Hidden field on a Registration form to set the Role for the user being registered. How would this actually work? What should we enter for the meta-key to connect this Hidden field to the wp-Role? Will this override the WP setting for the default Role?Is there a way to use the actual WordPress Role field instead? I tried that, but
– it does not seem to override the default Role specified in wp settings.
– it’s not very secure since the user can change the selection, even if the dropdown/select is disabled, he can re-enable it in firebug or something, change his selection, and submit the form.Is there any hook we can use to perform our own custom validation in php, to make it more secure? Can you suggest some simple code for that?
Thanks. –Todd
toddz70Member@khaledsaikat — Thanks this fixed the problem for me.
-
AuthorPosts