Struggling to understand how to use ‘Generated ID’
-
HI,
I have a basic need to modify post_title and slug before save (on post insert) … and on post update, do same if any of the fields used change:
- post title will be a concat of various form fields user has entered in the form
- post slug will be a simple case of calling sanitize_title() on the auto-generated post title as above
A couple of questions
In the Post Action -> Save tab … what does ‘Enter a custom value or template tag’ mean ?
- Does it mean I can achieve the auto-creation of the title or slug from concatenation of form fields by using template tags?
- if so, is there an example usage that you could point one to.
Your code examples in Post Action –> Code tab are very useful … but I am am not sure how to retrieve the values from cloned sub_fields (created with setting ‘Prefix Field Names’) with predictable field names.
- I am not able to see the field names for these cloned sub fields displayed in the ACF-E UI (only their parent field name).
- Will get_field(‘predictable_field_name’) work for these ?
Still on the Field Action –> Code tab, what is the use of ‘prev_post_action’ in the ‘Change post arguments’ example ? Is this really essential in my very simple use case?
Final questions:
- in the case of an update, how can I check whether values in the fields I am using to auto-generate the title and slug have changed ? What’s the most effective way of doing that?
- Will leaving post slug settings as default, while auto-generating titles give me the effect I am trying to achieve?
Thanks for this great tool, and thanks in advance for responding. This challenge is holding up important work I am doing, so I hope for a quick response.
- The topic ‘Struggling to understand how to use ‘Generated ID’’ is closed to new replies.