Hello.
Trying to use the CRED-edit-link on a Content Template and getting the error on screenshot 1.
We do have the CRED edit form (screenshot 2), with the shortcode as shown in screenshot 3.
Nothing else is in the edit Content Template (screenshot 4).
Thank you in advance for any help with this.
Dear Curt,
I assume you are using Layouts plugin, please follow our document to setup a layout to to display the CRED form for editing post, and display the edit link with shortcode [toolset-edit-post-link].
More help:
Displaying CRED editing forms
https://toolset.com/documentation/user-guides/displaying-cred-editing-forms/
Hi Luo,
1. Made a Layout (screenshot 1)
2. Assigned the CRED post form (screenshot 2)
3. Placed the CRED edit link on the CPT template (screenshot 3)
4. The CRED edit form shows up (screenshot 4)
5. When the image is edited or uploaded (screenshot 5)
6. ...it works (screenshot 6)
7. But, when the name or degree fields are changed (screenshot 7)...
8. ...the post title should change, and it does not. (screenshot 8)
In case it helps, we're using code from ToolSet to create the Provider CPT title from the post form first name, MI, last name and degree fields like so:
// ToolSet WP-Types
/* When creating a NEW PROVIDER CPT, create the post title from the provider's first, MI, last name and degree */
add_action('cred_save_data', 'custom_provider_title',10,2);
function custom_provider_title($post_id, $form_data)
{
// if a specific form
if ($form_data['id']==113 && isset($_POST)) {
// Update post {ID}
$title = $_POST['wpcf-provider-first-name'];
$title .= ' '.$_POST['wpcf-provider-middle-initial'];
$title .= '. '.$_POST['wpcf-provider-last-name'];
$title .= ', '.$_POST['wpcf-degree'];
$my_post = array(
'ID' => $post_id,
'post_title' => $title,
'post_name' => $title
);
// Update the post into the database
wp_update_post( $my_post );
}
}
Thank you for your help!
Since it is a custom codes problem, please provide a test site with the same problem, and fill below " private detail box" with the credentials and FTP access, also point out the problem page URL and CRED form URL, and where I can edit your custom PHP codes, I need a live website to test and debug, thanks
Thanks for the details, I am checking it in your website, will feedback if there is anything found
I assume we are talking about the CRED form "Add a Provider", and the page "Add a Provider", Where can I edit your custom PHP codes?
I tried the FTP access you provided, in the theme folder "wp-content/themes", there isn't theme "cookbook-child", please make sure the FTP access you provided is correct.
Hi Luo,
Yes, we're talking about the CRED forms 'Add a Provider' and 'Add a Practice', and the pages 'Add a Provider' and 'Add a Practice'. I assume that making the CRED edit link work on one will also work on the other.
Here is the new password for the site and for SFTP: qv#1Mhb5z4Y9^gbQ7JixvM9e
The SFTP path is: /wp-content/themes/divi-stork-app-theme
Thank you.
I checked again in your website:
Your screenshot:
hidden link
is refer to another "Provider" post:
hidden link
And related to another CRED form (ID 305):
hidden link
So you can simply edit your PHP codes from:
// if a specific form
if ($form_data['id']==113 && isset($_POST)) {
To:
// if a specific form
if (in_array($form_data['id'], array(113, 305)) // here you can add more CRED form ID
&& isset($_POST)) {
I just tested it here:
hidden link
It works fine.
More help:
hidden link
in_array — Checks if a value exists in an array