Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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