Support

Account

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;