CRED is a WordPress plugin that lets you easily build front-end forms for creating and editing content and users.
CRED User Guides include detailed documentation on creating forms, including related fields that belong to the content or the users, validating the input and displaying the forms with custom HTML styling.
When you ask for help or report issues, make sure to tell us the versions of the Toolset plugins that you have installed and activated.
Viewing 15 topics - 376 through 390 (of 674 total)
Problem:
The user would like to customize the success message in a form before the page is redirected.
Solution:
This will require custom code snippet to customize the message that would be displayed before the redirect. Something like:
add_filter('gettext', function($translated_text, $untranslated_text, $domain){
if($untranslated_text == 'Please Wait. You are being redirected...' && $domain == 'wp-cred'){
$translated_text = 'The new message to display before the redirect';
}
return $translated_text;
}, 10, 3);
Note that the message will be wrapped in a
tag, this means that you can't use any HTML tags, only the ones that can be wrapped in a
The user wanted the custom user field values from a user ID passed through the generic field in the form notification.
Solution:
Suggested to use the "cred_subject_notification_codes" and "cred_body_notification_codes" filters to register custom placeholders for form notifications.
Example:
add_filter('cred_subject_notification_codes', 'custom_generic_field_notification', 10, 1);
add_filter('cred_body_notification_codes', 'custom_generic_field_notification', 10, 1);
function custom_generic_field_notification( $defaultPlaceHolders ) {
// get the user ID from the generic field 'evaluatee-user-id'
$target_user_ID = $_REQUEST['evaluatee-user-id'];
// get the first name and last name from the $target_user_ID
$user_first_name = do_shortcode("[wpv-user field='user_firstname' id='".$target_user_ID."']");
$user_last_name = do_shortcode("[wpv-user field='user_lastname' id='".$target_user_ID."']");
// set those first name and last name values in the custom placeholders
$newPlaceHolders = array(
'%%evaluatee_first_name%%' => $user_first_name,
'%%evaluatee_last_name%%' => $user_last_name,
);
return array_merge($defaultPlaceHolders, $newPlaceHolders );
}