Skip to content

Update Row

The Update Row node modifies existing rows in a WP-Nexus database table, custom post type, or taxonomy. The input must include the row's ID to identify which record to update.

Configuration

PropertyTypeDefaultDescription
tableIdnumber--Required. The ID of the WP-Nexus table to update.

Input

Accepts a single object or an array of rows. Each row must include the appropriate ID field:

  • Custom tables: id
  • Custom post types: ID
  • Taxonomies: term_id

Output

Returns the input rows unchanged. On error, an _error field is added.

How It Works

Custom Table

  1. Extracts the id from the row.
  2. Removes id from the update data.
  3. Calls $wpdb->update() with the remaining fields.

Custom Post Type

  1. Extracts ID from the row.
  2. Updates core fields (post_title, post_content, post_status) via wp_update_post().
  3. Updates custom meta fields via update_post_meta().

Taxonomy

  1. Extracts term_id from the row.
  2. Updates core fields (name, slug, description) via wp_update_term().
  3. Updates custom meta fields via update_term_meta().

Example Use Cases

Edit form submission

Context --> Validate --> Sanitize --> Update Row (tableId: 3) --> Output

The form must include a hidden field or context value with the row id.

Toggle a status field

Context --> Set Field (status = 'completed') --> Update Row (tableId: 5) --> Output

Mark a todo as complete

Context --> Set Field (completed = '1') --> Set Field (completed_at = now()) --> Update Row --> Output

WARNING

The input must include the row's ID field. If the ID is missing, the node returns an _error without modifying any data.

TIP

Only the fields present in the input are updated. Omitted fields remain unchanged in the database.