@prefix sioc: <http://rdfs.org/sioc/ns#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix content: <http://purl.org/rss/1.0/modules/content/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

<https://lhero.org/portfolio/lh-post-locking/>
  a sioc:Post ;
  dc:title "How it works" ;
  dcterms:identifier 149615 ;
  dc:modified "2026-10-10T12:42:41Z"^^xsd:dateTime ;
  dc:created "2026-10-10T12:42:41Z"^^xsd:dateTime ;
  sioc:link <https://lhero.org/portfolio/lh-post-locking/how-it-works/> ;
  sioc:has_creator <https://lhero.org/author/1/#account> ;
  sioc:has_container <https://lhero.org/#posts> ;
  content:encoded """<ul class="lh_portfolio-meta"><li><strong>Part of:</strong> <a href="https://lhero.org/portfolio/lh-post-locking/">LH Post Locking</a></li></ul>
<p class="wp-block-paragraph">A lock is a flag stored in post meta, beside the post status rather than instead of it. A locked post can be published, private, draft or any custom status, and front-end queries, sitemaps and feeds treat it exactly as they would an unlocked post.</p>



<h2 class="wp-block-heading">Storage</h2>



<ul class="wp-block-list"><li><code>_lh_post_locking_locked</code>: present (as 1) only while the post is locked, and deleted on unlock, so finding locked posts is a query on an indexed meta key.</li><li><code>_lh_post_locking_locked_by</code> and <code>_lh_post_locking_locked_at</code>: who locked the post and when (GMT), cleared on unlock.</li></ul>



<p class="wp-block-paragraph">The flag is registered for the REST API so the block editor can read and save it. Only users with the lock capability can write it.</p>



<h2 class="wp-block-heading">Enforcement</h2>



<p class="wp-block-paragraph">A <code>map_meta_cap</code> filter adds <code>do_not_allow</code> to <code>edit_post</code>, <code>edit_page</code>, <code>delete_post</code>, <code>delete_page</code> and <code>publish_post</code> on a locked post for anyone without the lock capability (<code>manage_options</code> by default). Edit and Trash links disappear for them, and the editor and REST API refuse changes.</p>



<p class="wp-block-paragraph">Comment moderation is deliberately left alone: core checks <code>edit_comment</code> through <code>edit_post</code>, so the plugin recomputes it without the lock and editors can still approve, edit or remove comments on a locked post.</p>



<h2 class="wp-block-heading">Interface</h2>



<ul class="wp-block-list"><li>Block editor: a Lock editing checkbox in the post status panel, under Status and Visibility.</li><li>Classic editor: the same checkbox in the Publish box.</li><li>List tables: a Locked post state after the title, a Locked view with a count, and Lock editing and Unlock editing bulk actions.</li></ul>



<p class="wp-block-paragraph">Users without the lock capability see none of these controls.</p>



<h2 class="wp-block-heading">Lockable post types</h2>



<p class="wp-block-paragraph">Every post type with an admin screen and custom-fields support, except attachments. Custom-fields support is needed for the meta to reach the block editor.</p>



<h2 class="wp-block-heading">Copies</h2>



<p class="wp-block-paragraph">A post copied with LH Copy to Draft starts unlocked, with no lock history, and no unlock event fires for it.</p>
"""^^rdf:XMLLiteral ;
  sioc:content """Part of: LH Post Locking
A lock is a flag stored in post meta, beside the post status rather than instead of it. A locked post can be published, private, draft or any custom status, and front-end queries, sitemaps and feeds treat it exactly as they would an unlocked post.



Storage



_lh_post_locking_locked: present (as 1) only while the post is locked, and deleted on unlock, so finding locked posts is a query on an indexed meta key._lh_post_locking_locked_by and _lh_post_locking_locked_at: who locked the post and when (GMT), cleared on unlock.



The flag is registered for the REST API so the block editor can read and save it. Only users with the lock capability can write it.



Enforcement



A map_meta_cap filter adds do_not_allow to edit_post, edit_page, delete_post, delete_page and publish_post on a locked post for anyone without the lock capability (manage_options by default). Edit and Trash links disappear for them, and the editor and REST API refuse changes.



Comment moderation is deliberately left alone: core checks edit_comment through edit_post, so the plugin recomputes it without the lock and editors can still approve, edit or remove comments on a locked post.



Interface



Block editor: a Lock editing checkbox in the post status panel, under Status and Visibility.Classic editor: the same checkbox in the Publish box.List tables: a Locked post state after the title, a Locked view with a count, and Lock editing and Unlock editing bulk actions.



Users without the lock capability see none of these controls.



Lockable post types



Every post type with an admin screen and custom-fields support, except attachments. Custom-fields support is needed for the meta to reach the block editor.



Copies



A post copied with LH Copy to Draft starts unlocked, with no lock history, and no unlock event fires for it.
""" ;
  sioc:topic <https://lhero.org/?taxonomy=author&term=cap-1> .

<https://lhero.org/author/1/#account> rdfs:seeAlso <https://lhero.org/author/1/?feed=lhrdf&format=turtle> .
<https://lhero.org/?taxonomy=author&term=cap-1> rdfs:seeAlso <https://lhero.org/?taxonomy=author&term=cap-1&feed=lhrdf&format=turtle> .
