Skip Navigation

[Resolved] Error, when do_shortcode: "The Toolset Form contact-form does not exist"

This support ticket is created 5 years, 10 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.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 4 replies, has 2 voices.

Last updated by adrianM-6 5 years, 10 months ago.

Assisted by: Christian Cox.

Author
Posts
#1180073
2019-01-08 15_31_39-Window.png

Hello,

I've created a form "contact-form", which can normally embedded into posts and pages.

But If I want to embed it (at the end of each page) using

echo do_shortcode('[cred_form form="contact-form"]')

the following error is shown:

The Toolset Form contact-form does not exist

If I use the ID instead the forms slug I got other errors. See attached image.

So, how can I render a form outsite of the normal "content"?

Thanks,

Adrian

#1180149

My issue is resolved now. Thank you!

#1180150

Hello,

The problem was with sanitize_title. I wanted to append the ID of the post to the permalink. Unfortunately this breaks some functionality.

add_filter('sanitize_title', 'drproperty_sanitize_title', 10, 3);

function drproperty_sanitize_title($title, $raw_title, $context = '') {
    if (strtolower($context) == 'save' && get_post_type(get_the_ID()) === 'property') {
       return $title . '-' . get_the_ID();
    }
    return $title;
}
#1180173

Hi, I'm not sure I understand exactly what you are trying to do. Are you saying you want to append the ID of the new post to its own permalink, or you want to append the ID of the post where the Form is displayed to the new post permalink?

#1180673

I wanted to change the permalink to contain the ID (only for custom post type "property"), when the post is saved.

The WordPress documentation is not good on this.

I found another hook, which is better for this: wp_unique_post_slug