@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-mcp-general-abilities/>
  a sioc:Post ;
  dc:title "Menus, template parts and synced patterns" ;
  dcterms:identifier 152514 ;
  dc:modified "2026-10-26T01:31:20Z"^^xsd:dateTime ;
  dc:created "2026-10-26T01:31:20Z"^^xsd:dateTime ;
  sioc:link <https://lhero.org/portfolio/lh-mcp-general-abilities/menus-template-parts-and-synced-patterns/> ;
  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-mcp-general-abilities/\">LH MCP General Abilities</a></li></ul><p class=\"wp-block-paragraph\">Since 1.20.0, <code>create-post</code> and <code>update-post</code> can write a block theme&#8217;s menus (<code>wp_navigation</code>), template parts (<code>wp_template_part</code>) and synced patterns (<code>wp_block</code>). Before that both abilities were hard-coded to drafts, which left no way to edit a block theme&#8217;s menus or header from MCP: these types do nothing until they are published.</p><h2 class=\"wp-block-heading\">Per-type rules</h2><p class=\"wp-block-paragraph\">What each ability may do is set per post type by <code>LH_MCP_General_Abilities_Post_Type_Rules</code>, filterable through <code>lh_mcp_general_abilities_post_type_rules</code>. A type with no rule cannot be written at all. Types added through the older <code>lh_mcp_general_abilities_return_writable_post_types</code> filter still work and get the default rule.</p><figure class=\"wp-block-table\"><table><thead><tr><th>Type</th><th>create-post</th><th>update-post</th><th>Extra</th></tr></thead><tbody><tr><td>post, page, others</td><td>draft, pending</td><td>draft, pending</td><td>Default rule</td></tr><tr><td>wp_navigation</td><td>draft, publish</td><td>draft, publish</td><td>Fallback guard; navigation blocks only</td></tr><tr><td>wp_block</td><td>draft, publish</td><td>draft</td><td></td></tr><tr><td>wp_template_part</td><td>draft, publish</td><td>draft</td><td>Override guard; slug required</td></tr></tbody></table></figure><p class=\"wp-block-paragraph\">The design types need <code>edit_theme_options</code>, and publishing anything needs the type&#8217;s <code>publish_posts</code>. Menu content may only hold <code>navigation-link</code>, <code>navigation-submenu</code>, <code>page-list</code> and <code>home-link</code> blocks. A published menu can be revised in place; a published template part or synced pattern cannot, because the change would be live everywhere it is used. Live template parts go through lh-mcp-site-design&#8217;s propose, preview and apply flow instead.</p><h2 class=\"wp-block-heading\">Guards</h2><p class=\"wp-block-paragraph\">A guard runs only when a write would leave the post published, and a refusal writes nothing.</p><ul class=\"wp-block-list\"><li><strong>Navigation fallback.</strong> A Navigation block with no menu of its own, or one pointing at a menu that is missing or not published, renders the most recently published menu. Publishing a new menu would take over all such blocks silently, so it is refused while any rendered template or template part has one. A block pointing at the menu being published is not counted, and editing a menu that is already published is always allowed. Blocks with their own inline links, and blocks in synced patterns or post content, are not counted.</li><li><strong>Template part override.</strong> Publishing a template part whose slug the active theme (or its parent) ships is refused, because it would replace the theme&#8217;s part live. Create it under a new slug and point the template at it. <code>create-post</code> also refuses a slug the theme already has in the database, and assigns the active theme and the chosen <code>area</code> to every part it creates.</li></ul><p class=\"wp-block-paragraph\"><code>update-post</code> refuses a <code>date</code> change on anything published or being published, since on a menu the date decides which menu is the fallback.</p><h2 class=\"wp-block-heading\">Audit trail</h2><p class=\"wp-block-paragraph\">Every write to a design type is recorded in LH Audit Trail as <code>site_design.post_saved</code> (staff only, kept 730 days), with the action, statuses before and after, the fields changed and <code>replaced_revision_id</code>: a revision holding the content as it was before the write, saved first if one did not already exist. The ability returns the entry as <code>audit_entry_id</code>.</p>"^^rdf:XMLLiteral ;
  sioc:content "Part of: LH MCP General AbilitiesSince 1.20.0, create-post and update-post can write a block theme&#8217;s menus (wp_navigation), template parts (wp_template_part) and synced patterns (wp_block). Before that both abilities were hard-coded to drafts, which left no way to edit a block theme&#8217;s menus or header from MCP: these types do nothing until they are published.Per-type rulesWhat each ability may do is set per post type by LH_MCP_General_Abilities_Post_Type_Rules, filterable through lh_mcp_general_abilities_post_type_rules. A type with no rule cannot be written at all. Types added through the older lh_mcp_general_abilities_return_writable_post_types filter still work and get the default rule.Typecreate-postupdate-postExtrapost, page, othersdraft, pendingdraft, pendingDefault rulewp_navigationdraft, publishdraft, publishFallback guard; navigation blocks onlywp_blockdraft, publishdraftwp_template_partdraft, publishdraftOverride guard; slug requiredThe design types need edit_theme_options, and publishing anything needs the type&#8217;s publish_posts. Menu content may only hold navigation-link, navigation-submenu, page-list and home-link blocks. A published menu can be revised in place; a published template part or synced pattern cannot, because the change would be live everywhere it is used. Live template parts go through lh-mcp-site-design&#8217;s propose, preview and apply flow instead.GuardsA guard runs only when a write would leave the post published, and a refusal writes nothing.Navigation fallback. A Navigation block with no menu of its own, or one pointing at a menu that is missing or not published, renders the most recently published menu. Publishing a new menu would take over all such blocks silently, so it is refused while any rendered template or template part has one. A block pointing at the menu being published is not counted, and editing a menu that is already published is always allowed. Blocks with their own inline links, and blocks in synced patterns or post content, are not counted.Template part override. Publishing a template part whose slug the active theme (or its parent) ships is refused, because it would replace the theme&#8217;s part live. Create it under a new slug and point the template at it. create-post also refuses a slug the theme already has in the database, and assigns the active theme and the chosen area to every part it creates.update-post refuses a date change on anything published or being published, since on a menu the date decides which menu is the fallback.Audit trailEvery write to a design type is recorded in LH Audit Trail as site_design.post_saved (staff only, kept 730 days), with the action, statuses before and after, the fields changed and replaced_revision_id: a revision holding the content as it was before the write, saved first if one did not already exist. The ability returns the entry as audit_entry_id." ;
  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> .
