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
My issue is resolved now. Thank you!
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;
}
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?
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