Home › Forums › ACF PRO › Front end form,how to change post_title and post_content properties › Reply To: Front end form,how to change post_title and post_content properties
Hi @claw
I think the easiest way for you to achieve all of these is to create your own custom fields for the title and the editor. You can then hook into the acf/save_post
action hook and retrieve the values in these fields yourself and add them as the post title and post content.
A few things to note:
1. You have to run the remove_action before saving the post title and content (if you save them using wp_update_post) and add it back in after. Basically same thing as this explains with infinite loops except you apply it to acf/save_post: https://codex.wordpress.org/Plugin_API/Action_Reference/save_post
2. You’re gonna end up with two extra fields in the admin area for these title and content fields. You can remove them in the admin area using CSS or simply disable them (to stop user from being able to interact with them) using this filter: https://www.advancedcustomfields.com/resources/acfload_field/
and setting $field['disabled'] = 1;
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.