Home Forums General Issues Check for new repeater row and update 'last modified' field


Check for new repeater row and update 'last modified' field

  • I’m looking to create a ‘last modified’ date on a per-field basis for a few repeater fields. I’m using acf_form() on the front-end to allow users to login and update their profile info and I found a snippet on another post which gets me most of the way there, but unfortunately, on update, it’s updating all my date fields at the same time rather than on a per-field basis.

    function add_new_service( $post_id ) {
    	// New Services Last Modified Date
    	if( $_POST['acf']['field_5d23aa0012797'] ) : 
    	    update_field('field_5d330ce090d97', "New Service!" , $post_id);
    add_filter('acf/save_post' , 'add_new_service', 10, 1 );

    I know I need to add some kind of test to see if the repeater field has a new row, but I’m not sure how to do that.

    Does anybody have any thoughts or examples as to how I could achieve this?

  • I should add, I have multiple filters running and at the moment, I’m adding “New Service!” instead of a date given that I need to see if my various ‘last modified’ date’ fields are being updated separately.

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Check for new repeater row and update 'last modified' field’ is closed to new replies.