Support

Account

Home Forums Front-end Issues Front End User Profile Edit – Repeater Sections

Solving

Front End User Profile Edit – Repeater Sections

  • I have no idea how to render a repeater field on the front end.

    I am trying to allow my users to edit their profile data after logging in. I have a very stylized user edit page so just displaying the acf_form() is not what I need.

    I have individual calls for text boxes and dropdown lists already. But now I need a repeater section. Anyone know how to do that?

    Here’s what I use for drop down lists:

    <?php
    								$field_key = "field_56abaa460d64b";
    								$field = get_field_object($field_key, 'user_'.$current_user->ID);
    								
    								if( $field )
    								{
    									echo '<select id="acf-' . $field['key'] . '" name="acf[' . $field['key'] . ']" style="width: 100%;">';?>
    										<option value="<?php the_author_meta( 'select_model1', $current_user->ID ); ?>" selected="selected" data-i="0"><?php the_author_meta( 'select_model1', $current_user->ID ); ?></option>
    										<?php foreach( $field['choices'] as $k => $v )
    										{
    											echo '<option value="' . $k . '">' . $v . '</option>';
    										}
    									echo '</select>';
    								}							
    							?>
  • have you tried using the acf_form() function?

  • I looked at your last few posts, and they are all pretty much concerning the same thing. You can use acf_form to render the entire form. Is there a specific reason you’re trying to re-build the whole form from scratch?

  • Yes, I understand that I could use acf_form(). However that just spits the fields out in a list. It doesn’t give me any control over where the fields show up.

    I have certain fields that only will only be seen IF they are a certain level of member to my site. So I have to wrap those items inside special code.

    acf_form() doesn’t give me that kind of control…at least as far as I know.

    Therefore, I would like to generate the fields manually. I just need some help.

  • Hi @juiceex

    You can use an fields option to show certain fields. It should be like this:

    'fields' => array('field_1234567890', 'field_0987654321'),

    This page should give you more idea about it: http://www.advancedcustomfields.com/resources/acf_form/.

    If you want to make the form manually, please take a look at the source code to learn how ACF works.

    I hope this helps.

  • I have multi users with same role

    i want to get all acf data where role is equal to educator

    is there any functionality which provide me my requisite data ??

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

The topic ‘Front End User Profile Edit – Repeater Sections’ is closed to new replies.