We’re rewarding the question askers & reputations are being recalculated! Read more.
6

The root of your problem is not object oriented programming, but a fundamental misunderstanding about how PHP handles requests. If this were a Java or a Node application for example, you would start the application on the server, and it would recieve requests, and respond. It's a continuous active program. As a result, you can store things in memory and ...


1

Yes, there is a function in WP for that: wp_check_post_lock() Give it the post ID and it will return the user ID that is currently editing the post OR false if no one is editing the post (i.e. it is not locked). $is_locked = wp_check_post_lock( $post_id ); if ( false === $is_locked ) { // Post $post_id is not not locked for editing } else { //...


Only top voted, non community-wiki answers of a minimum length are eligible