Enable/disable comments in frontend
Author | Posts |
---|---|
July 23, 2014 at 4:48 am 23999 | |
Chris Swede | I would like to make a feature request for the optional choice to let post author disable or enable comments in frontend post creation and editing forms on a per post basis (like is standard in the backend post edit screen), or is this already possible in WPUF? Thanks for the great plugin WPUF you have provided us with. Excellent work and great new features! |
August 3, 2014 at 12:08 pm 24420 | |
Sk | Hello Chris, Thank you. |
August 3, 2014 at 4:12 pm 24431 | |
Sekander Badsha | Hello Chris, So combining the two thread above, I’ve come up with the solution for you. return $args; add_filter( ‘wpuf_add_post_args’, ‘wpufe_comment_status’ ); Save the file and make a post. See what happens and let me know. |
August 3, 2014 at 8:55 pm 24452 | |
Chris Swede | Hi Sekander, Thanks a lot for this. It is really useful. It works with one exception. If you turn off the comments on the wpuf frontend edit post page and save, then you can’t turn them back on again. In the wpuf frontend create new post it works. The ideal solution would be to have a checkbox just like WordPress does in the backend, where you can check/uncheck to enable comments since a dropdown is not meant when the selection is between only two alternatives. When the wpuf |
September 17, 2014 at 5:55 pm 26942 | |
Chris Swede | Hi again, I mark this as unresolved since it is not working correctly. It would be a very useful and appreciated feature to include this option in the WPUF form builder. Preferably displayed as a single checkbox in the front-end add post and edit post forms, like its done in the WP-admin post edit area. At the moment it works but in a clumsy way due to the dropdown in the add new post form, whereas in the edit post form it does not work at all. |
September 21, 2014 at 5:58 pm 27122 | |
Sekander Badsha | Are you saying that the comment status is not working when a post is edited? |
October 9, 2014 at 3:54 pm 28113 | |
Chris Swede | Hi Sekander, |
October 15, 2014 at 4:40 pm 28429 | |
Sekander Badsha | Hello Chris, I have tested this but failed to reproduce the issue. Please check if you have the latest version of the plugin installed. If the issue is happening in 2.2.6 then check for your theme or plugin conflicts. You can disable all your plugins except User Frontend and switch to a default theme of WordPress like- Twenty Twelve and let me know the results. Thank you 🙂 |
October 20, 2014 at 1:10 am 28694 | |
Chris Swede | Hi Sekander, Thank you for your patience with this. I have updated to 2.2.6 and the same problem persists. If comment status is set on a new post I can’t change it in post edit and comments will never display. In fact, what is saved in the post’s comment_status in the database is neither “open” nor “closed” but instead “o” or “c”. In both cases “o” and “c” the comments do not display since those are not a valid comment_status. |
October 22, 2014 at 11:51 am 28856 | |
Sekander Badsha | Hello Chris, I will test this again to find out the issue. Meanwhile you can check for theme or plugin conflict. Because from the code, you can clearly see that we have passed the same string we got from the dropdown field. So there is no chance to store the first letter. You can check by disabling all your plugins except WP User Frontend Pro and switch to a default theme of WordPress like – “Twenty Fourteen” (don’t forget to paste the above code) and check and let me know. Thank you 🙂 |
February 4, 2015 at 11:33 pm 35787 | |
Ari | I have a same problem. -Ari |
March 8, 2015 at 7:41 am 38489 | |
Chris Swede | Hi Sekander and Ari. This is a late reply and I am sorry for that, but I only had the opportunity to sort this out recently. The culprit in my case was a hidden field being added by WPUF, which sets comment status to “c” or “o” for reasons I have not researched. So by simply commenting out the line of code I got this to work with Sekander’s function above. The line of code is in render-form.php, line 545:
Hope this helps! |