geodirectory/manage-sort-option manages the Sort by dropdown: create adds an option, update edits one by ID, reorder sets the dropdown order.
Two details decide whether the result works.
At a glance
| Ability | geodirectory/manage-sort-option |
| Toolset | GeoDirectory — toolset/geodirectory |
| Group | GeoDirectory › Tabs, Sorting & Blocks |
| Requires | AcrossAI Pro, plus GeoDirectory active on the site |
| Capability | manage_options |
| Safety | Writes data |
| Repeatable | Not idempotent — each call changes the row set, so re-running is not a no-op |
| Ships in | AcrossAI Pro 0.9.16 and later |
Direction is identity; data type is correctness
The direction is part of the record rather than a property you toggle, so making a field sortable both ways means two create calls with two labels — “Price, low to high” and “Price, high to low”.
The data type is the one that produces wrong results rather than missing ones. Sorting a numeric column as text orders 10 before 9, because that is correct alphabetically. Set data_type to the column’s real type and the sort is numeric.
The source type comes from geodirectory/list-listing-fields, which is where to read it rather than guess.
Built-in keys — post_date, post_title, overall_rating, random — work alongside custom field names.
Setting is_default moves the flag off whatever currently holds it. There is only one default.
Reordering takes the complete list.
Not idempotent for create.
Input
| Name | Type | Required | What it is |
|---|---|---|---|
action | string | Yes | create, update or reorder. |
post_type | string | No | Listing type, for example gd_place. Defaults to the site default. See geodirectory/get-directory-overview for the valid values. |
id | integer | For update | Sort option ID. |
htmlvar_name | string | For create | The field to sort by — a custom field key, or a built-in such as post_date. |
sort | string | No | Sort direction. Part of the record’s identity, not a togglable property. |
frontend_title | string | For create | The dropdown label, for example Price, low to high. |
field_type | string | No | The source field’s type. Defaults to text. |
data_type | string | No | The column’s data type. Matters for numeric sorting. |
is_active | boolean | No | Whether the option appears in the dropdown. |
is_default | boolean | No | Make this the preselected sort. Moves the flag off the current default. |
sort_order | integer | No | Position in the dropdown. |
order | array | For reorder | The complete ordered list of option IDs. |
What comes back
| Name | Type | What it is |
|---|---|---|
option | object | The sort option after the write. |
success | boolean | Whether the call completed. |
message | string | A one-line summary of what happened, suitable for showing a human. |
error_code | string | Present 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:
Let people sort restaurants by rating.
It resolves to one call:
{
"ability": "geodirectory/manage-sort-option",
"parameters": {
"action": "create",
"htmlvar_name": "overall_rating",
"sort": "desc",
"frontend_title": "Highest rated first"
}
}Worth knowing
- Both directions means two options.
- A numeric column sorted as text puts 10 before 9.
- Only one option can be the default.
- Reordering needs the complete list.
Related abilities
- GeoDirectory List Sort Options — read the current set
- GeoDirectory List Listing Fields — the field types to use
Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager
Browse the rest: Every ability, by category