WordPress: Add row to ACF through the backend when creating a post

I’m kinda new to wordpress, I’m using advanced custom fields(with repeater) and custom post types UI plugins, this might be a bit confusing but this is what I’ve been stuck in a while:

I have a post type with 5 fields, 4 normal fields and 1 repeater, I want to add specific information to the first 4 regular fields and after pressing publish, to have the repeater add rows of information until I end up with the table needed.

for example, my 4 fields could be:
-Current amount(number)
-Date to start off(Date picker)
-Amount of months it will carry on(number) //each month will have a row
-Percent of Interest given each month(number)

After adding this information, I’d like to have the rows be generated In my 5th field which is a repeater, So if I, lets say, added this info:

-Current amount: 500
-Date to start off September: 2014
-Amount of months it will carry on: 3
-Percent of Interest given each month: 10%

To have the repeater show this table:

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
x    Date    x  Amount  x Interest added x
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
x Sept 2014  x   500    x       50       x
x Oct 2014   x   550    x       55       x
x Nov 2014   x   605    x      60.5      x
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

It’s Important to be able to view the information in the repeater in wordpress, and I found information about how to add info programmatically like this: http://wordpress.stackexchange.com/questions/152995/programmatically-add-acf-repeater-row-in-specific-order-position
But in that example, the user does this by using an interface on the front end, I must be able to do the same but while the admin is modifing the custom post in the backend, so basiclly I have no idea where to add my code.

Where should I place all my code?

Read more here: WordPress: Add row to ACF through the backend when creating a post

Leave a Reply

Your email address will not be published. Required fields are marked *