CRED plugin allows you to build forms for front-end user registration and editing. These forms can include user fields and display them with your HTML styling. They also support input validation and automatic email notifications.
When you ask for help or report issues, make sure to tell us the structure and the settings of your form.
Viewing 15 topics - 631 through 645 (of 683 total)
Problem: I would like to add a registration form that allows people to claim ownership of a post. Once an admin approves their ownership, the registrant becomes author of that post.
Solution:
If I were trying to do something like this, I would follow this process:
- Create a new CPT called Pending Approvals
- Add custom fields to the Pending Approval CPT - user ID, university ID, college ID, and school ID
- Use cred_save_data to create a Pending Approval post whenever someone submits the User Registration form while trying to claim ownership of a University, College or School.
- Save the new User's ID and the appropriate University, College or School ID in the Pending Approval post
- Create a View of Pending Approval posts. In the Loop of results, include a "Delete Post" link that can be used to decline the ownership request. Also include an Edit CRED form that edits the University, College, or School. Hide or remove all the visible inputs from this form except the submit button, and give it a name like "Approve Ownership"
- Use the cred_save_data hook to update the University, College, or School post author when this form is submitted, and trash the Pending Approval post.
- Insert the View of Pending Approval posts in a page that is restricted to site administrators.
I need that, on registration page, a user insert his/her birthdate and, only if the user is over 18, is allowed to subscribe himself.
If is under 18 he cannot continue.
I know how to check if the date is validated or not, but i don't know how to pass the value of the field: [cred_field field='data-di-nascita'] to the js code.
In the shortcode [cred_field], there isn't such a feature that can achieve what you want:
pass the value of the field: [cred_field field='data-di-nascita'] to the js code
You may consider some custom codes, for example, you can setup your own datapicker with some Jquery UI datepicker, setup the year range as what you want
Problem: I have a CRED Create User form that includes the first_name field. I would like to prevent Users from submitting an email address in this field.
Solution: The only way to implement this type of validation is to use PHP code on the backend and the cred_form_validate API. Then you could set up a custom regex or other string validation system to test the first name entered and return an error if necessary. Here's a simple example using the validation API to test the first name value:
add_filter('cred_form_validate','no_email_name_validation',10,2);
function no_email_name_validation($error_fields, $form_data)
{
//field data are field values and errors
list($fields,$errors)=$error_fields;
//uncomment this if you want to print the field values
//print_r($fields);
//validate if specific form
if ($form_data['id']==12345)
{
//check first name value
if ($fields['wpcf-first_name']['value']!='John')
{
//set error message for my_field
$errors['wpcf-first_name']='Only members named John are allowed'';
}
}
//return result
return array($fields,$errors);
}
Replace 12345 with the numeric ID of your CRED user form, and modify the conditional using your own custom validation code.
When a account is created and try and sign in, the password I've set is not being recognised?
Solution:
Edit the CRED form for creating users, in section "Content", click button "Auto-Generate Form", disable option "Autogenerate Password", and save the CRED form.
Problem: I added the patch for Google Captcha but I'm still having problems.
Solution: Make sure the patch code has been removed after updating to CRED 1.9.3 or higher, and deactivate any conflicting plugins with captcha settings.
Problem:
The problem here is that the user has his reset password form but it's not showing up for his logged in users.
Solution:
These forms were not actually created by CRED but views is just hooking into the default forms for wordpress and these are only accessible by logged out users.
I am trying to:
* Use the "WordPress Archive / Author archive" as a "VIEW" for each Author Profile.
* Remove extra space above Profile Picture
* Remove default about "Username" data on top.
* Make URL to Author Profile, NOT include their username maybe custom or company value.
I expected to see:
Metadata about that user.
Instead, I got:
Metadata about the main Administrator/Current Logged in user.
Solution:
It is expected result, the views shortcode [wpv-user] will output the current user information, in your case it needs some custom codes, for example:
1) Create a shortcode [archive-author-id] to get the user's ID of the archive author page, by adding below codes into your theme/theme-functions.php:
Problem:
Is it possible to have a link on the front-end users can use to delete their account?
Solution:
1. Make sure the settings when editing the custom post type at Toolset > Post Types under "Sections to display when editing..." include the author option.
2. Create a CRED form to edit users, which need include only a "Delete User" button, like so:
3. Add the following code to your theme's functions.php file or using a plugin such as Code Snippets, being sure to edit the id of the form created in the previous step:
/**
* Hook into CRED Edit User form submission
* to delete current user
*/
function tssupp_delete_user( $post_id, $form_data ){
if ( 203 == $form_data['id'] ) {
require_once( ABSPATH.'wp-admin/includes/user.php' );
$current_user = get_current_user_id();
wp_delete_user( $current_user );
}
}
add_action( 'cred_submit_complete', 'tssupp_delete_user', 10, 2 );
Problem: I added password and repeat password fields to my CRED edit User form, but I would like for them to be optional.
Solution: There are two workarounds for this issue now:
1. Add a generic checkbox field and use a CRED conditional to show or hide both password fields based on the checkbox status.
2. Use two generic fields instead of the standard CRED fields for password and repeat password. Use the same field names, but make them optional: