Hey guys,
I want to insert a "Post creating CRED form" programmatically in one of my template files (single-{post-type}.php). I thought I could just do
```
\do_shortcode('[cred-form form="form-slug"]');
```
When I display this form on a page through Layouts, the form is displayed with currently discussed warning "Warning: Creating default object from empty value". If I do it in template file with a shortcode like I mentioned above I just got the warning and the form is not displayed at all.
So is the form not displayed because of the warning or do I have to do something else to display the form?
And yes I really need to do it in PHP code, not with Layouts or Templates.
Thanks in advance.
Kind regards
Aleks
Dear Aleks,
Are we talking about the PHP warning message:
Creating default object from empty value in /cred/application/models/form/data.php ...
If it is, it is a known problem between the latest version of WordPress 4.8.3 and CRED plugin, our developers are working on it, I'll keep you updated here as work progresses or a patch becomes available.
Ok, I read the topic about the php warning. But nevertheless: how to insert the form in php code?
My bad, just forgot to echo the \do_shortcode('[cred-form form="form-slug"]');