Support

Account

Home Forums Front-end Issues Customize the acf_form

Solving

Customize the acf_form

  • Hoi Elliot,

    First of all thanks for the great plugin. This week I purchased the PRO v5 and am very happy with the repeater fields. The other “add-ons” I haven’t looked at yet, but I will soon.

    What I am looking for is a good example of changing the acf_form output. I have read all the documentation, support tickets and other forums. I am pretty sure that I need to hook into filters like acf/load_field, acf/pre_save_post and acf/save_post, but I am pretty new to php and filters and hooks. I understand the most of it, but I get things done through examples and I can’t find enough examples for what I want.

    I know how to use the options in the acf_form() function, but I mean really advanced stuff like:
    – just simply adjust the html and css (classes etc.) (override acf_form() ????)

    – pre fill a selectbox with existing users filtered by unique tag or something like that.

    – Let the user order the table of repeated fields bij colomn

    – display subfields only if checked in the first field by checkbox. I have this working on the view side of the page, but have no clue how to handle this in edit mode (I use now the acf_form($options)). So only show the subfield if checked in the first field with checkboxes. (see attachments)

    – I have a save button on each field group and this works but if I click edit alle the field groups are opened with a save button, how can I get this to work for each individual field group. If I have the view in front and click the edit button on a group I only edit this group and the rest remains in view mode visible or not I am not sure yet.

    I hope you can give me some examples how to get things like this working, please be nice I am still learning a lot and sometimes can’t cope to much at the time. So please babysteps and explanation with the code.

    Thanks in advance and hope you can help me!

  • Anyone who can help me with some examples??

    The most important question for now is:
    – just simply adjust the html and css (classes etc.) (override acf_form() ????)

    How to use the acf/load_field, acf/pre_save_post and acf/save_post.

  • Hi Saskia,

    If I understood what you mean (sorry if I didn’t), you can disable the inclusion of backend styles and javascript by using this code in your functions.php:

    add_action( 'wp_print_styles', 'my_deregister_styles', 100 );
    
    function my_deregister_styles() {
    	wp_deregister_style( 'wp-admin' );
    }

    This will avoid any backend css to be included in the front-end.
    But even if you don’t do this, you can overwrite the styles by applying more specif classes in your style file, ie:

    body .container .class .input

    instead of:
    .class .input

    I also have a problem with the acf_form().
    My problem is I’m trying to create an user edit page but can’t find enough documentation too.

  • +1 on how to override acf_form() display code for custom html and css output?

  • +1 for this as well. Would love to be able to easily create a custom form using all functionality of ACF_PRO. I know you can use third party plugins, but many do not work great with repeaters

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

The topic ‘Customize the acf_form’ is closed to new replies.