Home Forums Backend Issues (wp-admin) Save clone with parent label


Save clone with parent label

  • Hey guys
    using: Advanced Custom Fields PRO – Version 5.8.11

    been trying to find a hook where I can apply this solution but I need a little direction.

    I am trying to set a rule where, Whenever I use a clone field it would get
    saved with the parent field label (not part of it and not manually.

    I would like to write the solution and tested some filters but
    I guess I am targeting the wrong ones.

    the clone fields I am using across (multiple) sites cant have a “one label fits all”…
    it’s bad for the client and doesn’t convey the use in relation to the section
    At the frontend.

    Is there any filter I can use to save that field (Relative to each location)
    with the parent label as its label? something I can use to create as a global solution?

    & much love


  • You cannot change where ACF save the value.

    You could possibly use acf/prepear_field to alter the label shown to the user based on where it is being shown

  • I would love to do that (only change the display) – that’s even easier.
    However… as it seems (example:
    the information meaning the original field label isn’t included in the
    cloned field data. is there another hook/filter way to do this?

    If you think about it
    making a global field which u can use across page templates / locations
    needs a ‘relative to location’ title… so this is not a weird idea.

    $parent = get_field_object($field['parent']);
    $label = $parent['label'];
Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Save clone with parent label’ is closed to new replies.