This function will update a row of data for an existing repeater field or flexible content field value.

Change Log

  • Added in version 5.3.2


update_row( $selector, $row, $value, $post_id )
  • $selector: (required) The parent field name or key
  • $row: (required) The row number to update
  • $value: (required) The new value to append
  • $post_id: (optional) The post ID of which the value is saved to. Defaults to current post


This function will return true upon success or false upon failure.


  • Row numbers start from 1 (not 0). For example, the first row of values is considered $i = 1
  • It is possible to change the row index starting point so that row numbers start from 0 using the row_index_offset setting.



This example demonstrates how to update a row of data for an existing repeater field called ‘images’. This repeater field contains 3 sub fields (‘image’, ‘alt’, ‘link’).


$row = array(
	'image'	=> 123,
	'alt'	=> 'Another great sunset',
	'link'	=> 'http://website.com'

update_row('images', 1, $row);


We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.