• Resolved ooo

    (@huyw37o)


    Hello WCVendors Team. I already sit on this issue for a few days, trying to fix it for myself, but I did not found a good solution yet.

    WCVendors have the feature that if a vendor creates a brand new product, it gets the post status “pending review”, so the admin can check before it gets online.

    You also have the feature to give the vendor the option to edit products which are live/online.

    What I need is, a feature that vendors can edit live/online products but if they actually made changes to the product, it should go back to the post status “pending review” instead of getting published with unknown changes without my consent.

    I tried to fix it for my own with this little script, but as you see its a pretty dirty fix. I am searching for a pure php script, so users can not manipulate it.

    add_action( ‘init’, ‘savePendingReview’ );
    function savePendingReview() {
    if(is_admin()) {
    global $pagenow;
    if(!current_user_can(‘administrator’) && ‘post.php’ === $pagenow) {
    echo ‘<script>
    window.addEventListener(“load”, function() {
    document.getElementById(“post_status”).selectedIndex = “1”;
    </script>’;
    }
    }
    }

    Is it possible to set the post status ALWAYS on pending review, if the user clicks on save/publish?

Viewing 1 replies (of 1 total)
  • Hello,

    You’ll need to hook into the save_post action and check the post_author to make sure its a vendor. Then change the post_status to pending. This will ensure that the post will always require review.

    Unfortunately we cannot provide support for custom code like this.

    cheers,

    Jamie.

Viewing 1 replies (of 1 total)
  • The topic ‘Vendor save/publish should always change post status = pending review’ is closed to new replies.