Home Forums Add-ons Repeater Field Repeater field update_subfield


Repeater field update_subfield

  • Hi!

    Is there a way to assign a subfield value to an other subfield in the same row of a repeater field? If so, how can I do it? I would like to assign a Page Link type field’s value to a URL type field in every row of a repeater field. Dynamic Content For Elementor plugin only allows to use URL type field values as links in their repeater field widget, but the Page Link type field is much more handy and useful so I thought maybe I could pull the value from Page Link to URL field and then work further with the URL field, but nothing worked for me.

  • I was trying with different versions of this code, but I got fatal error from wp when the code activated:

    if( have_rows(‘testrepeater’) ) {
    $i = 0;
    while( have_rows(‘testrepeater’) ) {
    $subfield_key_var = get_sub_field(‘pagelink_testfield’);
    update_sub_field(‘url_testfield’, ‘$subfield_key_var’);

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

You must be logged in to reply to this topic.