Support » Plugin: Gravity Forms Sticky List » Delete button permanently deletes Post and does not send it to Trash

  • On the Sticky List settings page, I have the “On delete” option set to “Move to Trash”. But when a member clicks on the Delete button, the Post gets deleted permanently even though I have set it to “Move to trash” in the Sticky List settings page.

    Is anyone else having the same problem? Is there a fix for this or is this a known bug?

Viewing 2 replies - 1 through 2 (of 2 total)
  • OK, looks like I have found a bug with this plugin. If you are using Gravity Forms Sticky List version 1.4.1, you need to change one line in the code to make the Delete button move the Post to Trash.

    In the file class-sticky-list.php, on line 1094.

    wp_delete_post( $delete_post_id, false );

    …should be changed to…

    wp_trash_post( $delete_post_id );

    You can find the documentation here Function Reference/wp trash post
    Hope that helps someone else with the same issue I was having.

    • This reply was modified 3 years, 10 months ago by .
    Plugin Author fried_eggz


    This is strange. According to the documentation

    wp_delete_post( $delete_post_id, false ) is equivalent to wp_trash_post( $delete_post_id )

    The second parameter a bool variable (true/false) that set weather to bypass trash or not.

    wp_delete_post() automatically reverts to wp_trash_post() if $force_delete is false, the post_type of $postid is page or post, $postid is not already in the trash and if that trash feature enabled (which it it is by default).

    Note that this only affects entrys that have a WordPress post connectd to them.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Delete button permanently deletes Post and does not send it to Trash’ is closed to new replies.