Skip Navigation

[Resolved] The CRED-edit-link is not working

This support ticket is created 6 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 7 replies, has 2 voices.

Last updated by Luo Yang 6 years, 10 months ago.

Assisted by: Luo Yang.

Author
Posts
#602073
screenshot 4.png
screenshot 3.png
screenshot 2.png
screenshot 1.png

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.

#602111

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/

#602163
screenshot8.png
screenshot7.png
screenshot6.png
screenshot5.png
screenshot4.png
screenshot3.png
screenshot2.png
screenshot1.png

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!

#602395

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

#602486

Thanks for the details, I am checking it in your website, will feedback if there is anything found

#602498

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.

#602787

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.

#602831

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