WordPress.org

Ready to get started?Download WordPress

Forums

Gravity Forms - Update Post
Updating a post deactivates comments (6 posts)

  1. hilj
    Member
    Posted 1 year ago #

    Hello,

    Whenever I update a post the comments are deactivated. Updating the post from the backend keeps the comments on as suposed to.

    It is a custom post type and I'm using the Gravity Forms custom post type plugin to enable this.

    Hope somebody can help me :) Thanks!

    http://wordpress.org/extend/plugins/gravity-forms-update-post/

  2. MarceFX
    Member
    Posted 1 year ago #

    Hi,

    Same issue :-/ Any ideas?

    Thanks

  3. MarceFX
    Member
    Posted 1 year ago #

    Found it! So far, this fix has work for me:

    mysql_query("UPDATE wp_posts SET comment_status = REPLACE (comment_status, 'closed', 'open') WHERE post_status = 'publish' AND post_type = 'product';");

    Add it to the end of the end of gravityforms-update-post.php

    ;-)

  4. hilj
    Member
    Posted 1 year ago #

    Very nice! Thank you :)

  5. Puggy
    Member
    Posted 1 year ago #

    I needed to get this done as well, but just running that SQL all the time didn't seem like a great solution so I dug a little and found Gravity Forms' Gform_post_data hook. Using this, here's how I fixed it:

    add_filter("gform_post_data", "open_comments", 10, 3);
    function open_comments($post_data, $form, $entry){
        $post_data["comment_status"] = "open";
        return $post_data;
    }

    This modifies the comment status as the form is submitted, without any extra SQL queries. You can also modify this to your liking to be more selective about which post types have comments open, or whatever extra logic you need. This can also be placed in your functions.php rather than modifying the plugin, if you prefer.

  6. myhero
    Member
    Posted 1 year ago #

    Hi guys this seems to be the only active thread here.

    Are you the version available here or this updated plugin:

    Update on Github (this is a file download link)

    I would like to use the update but I cannot get it to work, and do not know if I'm missing something in terms of setting it up.

    How were you able to get it working?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.