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 - 946 through 960 (of 1,498 total)
Problem:
The user was using a view inside the Avada Builder in a site hosted on SiteGround. Changes to the view were not reflected on the frontend until the page was saved in the Avada builder.
Solution:
It turns out to be caused by the "Dynamic Cache" in SiteGround hosting.
Problem:
The user was not able to edit a content template or a layout after updating the plugins. When we deactivate Toolset Forms the issue disappears.
Solution:
It turns out that the user is using PHP 8 when Toolset Forms is not yet fully compatible with it.
After downgrading the PHP version to PHP7, the issue disappeared.
Problem: I have a repeating custom field in a custom post type. When submitting a Form that creates this custom post type, I would like to create a cloned post that copies the values from the repeating custom field and inserts them automatically in the post clone.
Solution: Use wp_insert_post in a cred_save_data hook to create a clone of the original post. Get the repeating field value from the $_POST superglobal, and loop over those values in a foreach loop, or other similar loop structure. Use add_post_meta to insert each value into the custom field in the cloned post.
add_action('cred_save_data', 'my_save_data_action',10,2);
function my_save_data_action($post_id, $form_data) {
$forms = array( 123 );
if ( in_array( $form_data['id'], $forms ) )
{
$gallery = $_POST['wpcf-fieldslug'];
$new_book_args = array(
'post_title' => 'cloned book test from ' . $post_id,
'post_status' => 'publish',
'post_type' => 'book'
);
// Insert the cloned post into the database
$new_book_id = wp_insert_post( $new_book_args );
foreach( $gallery as $img ){
add_post_meta($new_book_id, 'wpcf-fieldslug', $img, false);
}
}
}
Problem: I have a Form that is used to create child post in a one-to-many post relationship. I would like to get the value of a custom field from the related parent post in a cred_save_data callback, but it does not seem to be working.
Solution: The relationship is not yet set in a cred_save_data hook, so you can either use the cred_submit_complete hook instead, or access the parent post ID directly from the parent select field in the $_POST superglobal.