admin管理员组文章数量:1277273
I am using native Gravity Forms to create posts.
I am using Gravity Forms + Custom Post Types to handle creating custom post type posts. This works great.
Its been about 3 years since i've had to create/update posts in a wordpress project using Gravity Forms. Back then it was super easy to update posts using Gravity Forms: Post Updates
It was so simple, just add update
to the end of the Gravity Form shortcode...
[gravityform id="2" title="false" description="false" ajax="true" update]
...and voila, the form would get all the current post data/custom fields and automatically map each Gravity Form post field and pre-renders each input with the current post data. When you save the form, it would update the current post instead of creating a new one. Job done.
Anyway, Gravity Forms: Post Updates no longer works because its not been updated in 4 years and upon installation in Wordpress 5.2.1, it throws a fatal error.
Plugin could not be activated because it triggered a fatal error.
Fatal error: Cannot use lexical variable $value as a parameter name in ../wp-content/plugins/gravity-forms-post-updates/gravityforms-update-post.php on line 1021
Thats spooned it so what is an alternative solution?
I don't want to have to custom code each field with a custom function using gform_pre_render
and gform_after_submission
filters/actions.
Please any ideas for Gravity Forms: Post Updates alternative would be awesome thanks.
I am using native Gravity Forms to create posts.
I am using Gravity Forms + Custom Post Types to handle creating custom post type posts. This works great.
Its been about 3 years since i've had to create/update posts in a wordpress project using Gravity Forms. Back then it was super easy to update posts using Gravity Forms: Post Updates
It was so simple, just add update
to the end of the Gravity Form shortcode...
[gravityform id="2" title="false" description="false" ajax="true" update]
...and voila, the form would get all the current post data/custom fields and automatically map each Gravity Form post field and pre-renders each input with the current post data. When you save the form, it would update the current post instead of creating a new one. Job done.
Anyway, Gravity Forms: Post Updates no longer works because its not been updated in 4 years and upon installation in Wordpress 5.2.1, it throws a fatal error.
Plugin could not be activated because it triggered a fatal error.
Fatal error: Cannot use lexical variable $value as a parameter name in ../wp-content/plugins/gravity-forms-post-updates/gravityforms-update-post.php on line 1021
Thats spooned it so what is an alternative solution?
I don't want to have to custom code each field with a custom function using gform_pre_render
and gform_after_submission
filters/actions.
Please any ideas for Gravity Forms: Post Updates alternative would be awesome thanks.
Share Improve this question edited May 26, 2019 at 16:13 joshmoto asked May 26, 2019 at 16:05 joshmotojoshmoto 4676 silver badges19 bronze badges1 Answer
Reset to default 1I found a solution to fix this issue on the plugin Github page.
It's not ideal, but a work around until Gravity Forms makes this a core feature.
https://github/jupitercow/gravity-forms-post-updates
To fix the error and allow the plugin to be installed, you have to change...
row 1021
in file gravityforms-update-post.php
from (version 1.2.17)...
add_filter( 'gform_field_value_' . $field['inputName'], function($value) use($value) { return $value; } );
to...
add_filter( 'gform_field_value_' . $field['inputName'], function($v) use($value) { return $v; } );
Thanks to bagendahl. So far i've not stumbled across any issues.
See the original Github issue thread here.
Hope this saves someone some time.
本文标签: Update post using gravity forms 2019 solution
版权声明:本文标题:Update post using gravity forms 2019 solution 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741218255a2360469.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论