wp-admin-postbox-sortable
Installation
SKILL.md
WordPress Admin Postboxes & Sortable
Use this skill when you need the familiar collapsible / draggable / Screen-Options-toggleable boxes that WordPress core uses on post edit and Dashboard, but on your own admin page or in your own draggable list. The most common failure mode is wiring up the HTML correctly, then watching the box collapse fine but never persist — because the nonce field is missing and the AJAX call silently fails.
When to use this skill
Trigger when ANY of the following is true:
- The user is calling
add_meta_box()on a custom screen (not just the regular post edit), or registering a custom screen and wants postbox behavior. - The user wants drag-and-drop reordering for a list of items in
wp-admin(option rows, repeater fields, custom panels). - Code references
postboxes.add_postbox_toggles,.meta-box-sortables,.postbox,.hndle,closedpostboxesnonce,meta-box-order-nonce,closedpostboxes_*,metaboxhidden_*, ormeta-box-order_*. - The user says "the collapse/expand works but doesn't save" or "drag works but order doesn't persist" or "Screen Options checkboxes don't appear on my page".
The four pieces that MUST be in place
The postbox UI looks like a single component but it's actually four things wired together. Miss one and the behavior degrades silently. None of this is automatic on a custom admin page.