Skip to content

createAdminAppearanceSectionDiscard

Throws away every staged edit of a theme and channel. The published content, statuses and order are left exactly as they are, so the storefront does not change.

Input fields

FieldTypeRequiredDescription
codeStringYesTheme whose staged edits are discarded.
channelIntNoChannel being discarded. Falls back to the current channel.

Payload fields

FieldTypeDescription
themeCodeStringTheme that was discarded.
channelIdIntChannel that was discarded.
sectionIdsIterableSections whose staged edits were thrown away. Empty when nothing was staged.
messageStringConfirmation text.

Use cases

  • Abandon an edit session — one call resets every section a merchant touched back to what shoppers already see.

Best practices

  • Discarding cannot be undone — a staged edit is the only copy of the unpublished work.
  • It does not restore deleted sections.
  • Like publishing, it works per theme and channel, not per section.

Permissions

Requires appearance.sections.edit.

Released under the MIT License.