30 days free. No credit card. Full access from the moment you connect your site.

Start free trial

Reorder Repeater Rows

Moving a repeater row is ordinarily a read-modify-write of the entire field: pull every row, reshuffle the array, write it all back. Get the array wrong and rows disappear.

custom-fields/reorder-acf-repeater-rows takes the new order as a list of 1-based indexes — [3, 1, 2] moves the third row to the front — and refuses anything that is not a complete permutation.

At a glance

Abilitycustom-fields/reorder-acf-repeater-rows
ToolsetAdvanced Custom Fields — toolset/acf
GroupRepeater & Flexible Content
RequiresAdvanced Custom Fields Pro, plus a repeater field registered on the site
Capabilitymanage_options
SafetyWrites data
RepeatableIdempotent — running it twice leaves the same result
Ships inAcrossAI Abilities Manager 0.0.34 and later

How it works

The order array must contain every current index exactly once. A list that is short, long, repeats an index or names one out of range is rejected before any write, rather than quietly dropping the rows it left out.

That strictness is the point. A reorder that silently discards rows is indistinguishable from a successful one until someone notices the missing content.

Because the new order is stated absolutely rather than as a move, the call is idempotent: sending the same order twice leaves the same arrangement.

Input

NameTypeRequiredWhat it is
target_typestringNo — defaults to postWhat the value is attached to: post, user, term, comment or option. post covers pages and any custom post type.
target_idinteger | stringYes, for post, user, term and commentThe ID of the target. Optional for option, where it names a specific options page; omit it for the default options store.
selectorstringYesRepeater or flexible-content field name (e.g. cards) or field key.
orderarray of integersYesThe new order as 1-based indexes. Must be a permutation of 1..row_count — every index exactly once, none missing or repeated.

What comes back

NameTypeWhat it is
orderarrayThe order as applied.
row_countintegerHow many rows the field holds.
successbooleanWhether the call completed.
messagestringA one-line summary of what happened, suitable for showing a human.
error_codestringPresent only on failure — a stable machine-readable reason, such as a missing field, a wrong field type or an unmet confirmation.

Example

Ask your assistant:

Move the last card in the features repeater on page 87 to the top, keeping the other two in order.

It resolves to one call:

{
  "ability": "custom-fields/reorder-acf-repeater-rows",
  "parameters": {
    "target_type": "post",
    "target_id": 87,
    "selector": "features",
    "order": [3, 1, 2]
  }
}

Worth knowing

  • Read the field first with custom-fields/get-acf-field to get the current row count and see which index is which.
  • Reordering changes positions, never values — sub-field data travels with its row.
  • Requires ACF Pro.

Related abilities


Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager

Browse the rest: Every ability, by category


Keep reading