0

I am creating a website where user have to be logged in to give a price bid on a product. Only one bid can be given on the product. Therefore, I only want one user at a time to be able to give a bid. Is it possible to lock post editing to one user from the frontend? So if 2 or more user enters a post simultaneously, could a message tell the other user that someone else is giving a bid?

I had a quick look at this function from post.php wp_check_post_lock, but if I call it from my theme, it is unrecognized.

2

Imagine the following situation: One user leaves the browser window.

What happens? No other user can place a bid.

If you're using to fire up the bid, then you can add the wp_check_post_lock() function in there. And also remove the lock. So the post is only locked as long as someone is actually placing/sending the bid. As this will only last for some ms, you have successfully worked around the post lock problem.

Edit

There's a new "post lock" feature for post types coming. This will be in 3.6 or 3.7. So far, no further details are known.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.