Vendor save/publish should always change post status = pending review
-
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?
- The topic ‘Vendor save/publish should always change post status = pending review’ is closed to new replies.