Can users delete permanently a post?

This topic contains 3 reply and 2 voices, and was last updated by Oritro Ahmed 10 years, 7 months ago
Viewing 3 Posts - 1 through 3 (of 3 total)
Author Posts
April 21, 2014 at 6:28 am 19158
Oritro Ahmed 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
April 21, 2014 at 4:33 pm 19179
Oritro Ahmed Oritro Ahmed

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.

April 21, 2014 at 8:00 pm 19190
maurodi maurodi

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

April 21, 2014 at 8:50 pm 19191
Oritro Ahmed Oritro Ahmed

Glad that we could help 🙂 Please keep us updated about your problem and Suggestions 🙂

Viewing 3 Posts - 1 through 3 (of 3 total)