How to lock a post or page
You can use the ‘wp_insert_post_data’ filter to set the data being updated to the ones post has right now: add_filter(‘wp_insert_post_data’, ‘prevent_post_edit’, 99, 2); prevent_post_edit ($data, $postarr) { if ( ! isset($postarr[‘ID’]) || empty($postarr[‘ID’]) ) return $data; if ( current_user_can(‘edit_files’) ) return $data; // admin can edit posts // prevent the update only for post and … Read more