Home Forums Plugin Support WP User Frontend Pro Feature request – Original post status after edit

This topic is: not resolved

Tagged: 

This topic contains 6 replies, has 3 voices, and was last updated by  bazelski 5 years, 11 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #4604

    RMAndres
    Participant
    Post count: 14

    Hey, I need to have the ability to give my users the power to edit ‘pending' and ‘published' posts without changing the original status, so if a user edits a ‘pending' post it'll stay as ‘pending' after the edit, if you can make it happen as a base feature and not as a personal ‘quick fix' I would be extremely happy.

    Keep up the good work!

    #4605

    Tareq Hasan
    Keymaster
    Post count: 2831

    So how should I deal with the edit post status settings (available in the form settings)?

    #4610

    RMAndres
    Participant
    Post count: 14

    I made it by creating an hidden input in the form with the name of ‘wp_post_status' and the value is a variable that gets the current post status, I then just have to equal the $postarr[‘post_status'] to the $_POST [‘wpuf_post_status'], rendering, with this personal fix, the form edit setting option for post status obsolete.

    A more open solution would be making another form setting option that would always get the current post status, maybe in a similar way as I did, but unfortunately I don't have the time for that now.

    best regards.

    #4622

    Tareq Hasan
    Keymaster
    Post count: 2831

    If you want to set pending post status to pending after edit, you can do that by setting the edit post status to pending. If you are overriding it, the post edit status setting has no value.

    #4626

    RMAndres
    Participant
    Post count: 14

    You don't seem to have understood my words, sorry but english is not my main language.

    What I did was:

    Author writes post – defaults to post status ‘pending';
    Author edits post – post status stays as ‘pending';
    Editor sees post and publishes it – post status changes to ‘publish';
    Author edits post – post status stays as ‘publish';

    #4666

    Tareq Hasan
    Keymaster
    Post count: 2831

    Ok, now I understand your requirements fine. For your purpose, the outline you gave is fine. But what if I wanted to be the new post status to pending and edited post status to publish. I agree that there should be some changes needed, like user shouldn't be able to edit posts while it's in pending mode.

    #4922

    bazelski
    Participant
    Post count: 28

    Exactly what I need

    Author writes post – defaults to post status ‘pending’;
    Author edits post – post status stays as ‘pending’;
    Editor sees post and publishes it – post status changes to ‘publish’;
    Author edits post – post status stays as ‘publish’;

    Why I can't use this conditional ?

    
    function wpuf_editor_post_status( $postarr ) {
     
        if ($postarr['post_status'] == 'publish') {
            $postarr['post_status'] = 'publish';
        }
     
        return $postarr;
    }
     
    add_filter( 'wpuf_update_post_args', 'wpuf_editor_post_status' );

    My post staus is set to pending after edit. This works good without this conditional statement if ($postarr['post_status'] == 'publish') {

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

The topic ‘Feature request – Original post status after edit’ is closed to new replies.