Skip to content

Defining post_title in hidden frontend form no longer possible #1019

Description

@MarcGuay

Describe the bug
I had a frontend form with a default post_title defined in a hidden form field added like so:
'html_before_fields' => '<input type="hidden" id="acf-_post_title" name="acf[_post_title]" value="Default Title">'. Submissions now have "(no title)" because line 278 of form-front.php requires the post_title argument to be true.

To Reproduce
Steps to reproduce the behavior:

  1. Create a frontend form using acf_form() that creates a new post, and make sure post_title is set to the default of false and you have added a hidden post_title field as described above.
  2. Submit the form
  3. Observe that the new post's title is "(no title)" rather than the one you defined in your hidden field.

Expected behavior
I expect the hidden field title to carry through to the post.

Version Information:

  • WordPress Version [7.0]
  • PHP Version [8.2]
  • ACF Version [ACF PRO 6.8.4]
  • Browser [Chromium 149.0.7827.196 ]

Additional context
I realize this isn't standard functionality but it's a method devs have used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions