Home Forums Plugin Support WP User Frontend Pro Can users delete permanently a post?

This topic is: resolved

Tagged: 

This topic contains 3 replies, has 2 voices, and was last updated by  Oritro Ahmed 5 years ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #19158

    maurodi
    Participant
    Post count: 5

    Hi. I would like to know if is it possible for a user delete permanently (empty trash) a post via frontend.
    Can you help me? Thank you

    #19179

    Oritro Ahmed
    Spectator
    Post count: 155

    Hello mauro,

    You have to do a little bit of coding for that.

    Go to wp-content/plugin/wp-user-frontend-pro/class and you will find a file called frontend-dashboard.php there. Please Open the file in a text editor.

    Scroll down, in line no 60, You will find a code block like this,

    //delete post
            if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == "del" ) {
                $this->delete_post();
            }

    All you have to do, just change $this->delete_post(); to wp_delete_post( $_REQUEST['pid'], true );

    The end result will be like this,

    //delete post
            if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == "del" ) {
                wp_delete_post( $_REQUEST['pid'], true );
            }

    I hope that will solve your problem.

    #19190

    maurodi
    Participant
    Post count: 5

    Great support. It works fine. I love your wplugin and your assistance!!!! Thank you

    #19191

    Oritro Ahmed
    Spectator
    Post count: 155

    Glad that we could help ๐Ÿ™‚ Please keep us updated about your problem and Suggestions ๐Ÿ™‚

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Can users delete permanently a post?’ is closed to new replies.