The New Post Form form enables users to add new posts to a custom or WordPress standard post type from the front end of a WordPress website, without needing to interact with the WordPress dashboard.
Important: By default a user needs to be logged in and carry the “administrator” role to add a post. This can be changed, however, in the Permissions settings of this form.
Adding the Form
In your WordPress dashboard, hover over “Frontend Admin for ACF” on the top bar and click “Create Form”.
Select “New Post Form” in the form type dropdown, give the form a title, and click “Create Form”.
At this point, you already have a functioning form that you can place anywhere using either the shortcode or the Gutenberg block. You may also simply publish the form and refer users to the form’s public URL seen under the form title:
In any case, you might also want to configure some settings based on your specific use case. Let’s take a look at the available settings.
This section defines the fields which are shown within the form itself. This is where you actually define what data the end-user can access.
By default, the form will have the Title, Content, Excerpt, Featured Image, and Status fields activated. These can be customized to whatever fits your needs.
Adding and Removing Fields
To add more fields simply click the Add Field button. Fields can be deleted by hover over the field and clicking the “Delete”.
You can add ACF fields by clicking Add Field and changing the field type of the new field to “ACF Fields” and then selecting the desired fields or groups.
Basic Field Attributes
The Field Type defines the type of field being edited. Changing this will affect other available options.
All the field types have options that can be changed to customize both the content and the style of the field.
- Label – This is shown above the field’s text box. This can be toggled to be displayed or hidden according to your needs.
- Instruction – This is shown in the smaller text under the Label.
- Required – Indicates whether or not the field can be left blank.
- Display Mode – Here you can either show the editable field, show just the value of the field, or hide the field altogher. Hiding the field can be useful if you want to pass default data which the end-user shouldn’t change.
Field Specific Options
As mentioned above, there are many options that are unique to a specific field type. We will cover some of the options for the default fields. There will be more articles going in-depth about each field’s options.
The Title Field is a simple text box. We have the standard Label, Instruction etc. Additionally, there is an option for adding Placeholder text, indicating what type of content is expected from the user.
The Content Field is also a text box. You can customize the text box type, it can be a simple Text Area or a Text Editor with more advanced options for the end-user.
This allows your users to add a featured image to the post. In addition to the basic attributes, you can add a default image if you wish.
This will the user to decide what the post should have. You can choose to show any Post Status that exists in your site.
If the option “Save Form Submissions” is turned on, you will see an additional option called “Submission Requirments“. This allows you the option to review form submissions before they go live on your site. Leaving it blank will save the data immediately upon form submission. If you wish to manually review the submissions before they go live, choose “Admin Approval”. The submissions will then be saved in the Submission section and you can approve or delete them you
Here we have several options for additional actions to take place once the form is submitted.
Redirect After Submit
Here you can define where the page should redirect to after submitting. By default, it will reload the current Page/Post. You can also choose to redirect to the newly created post page by selecting Post URL.
Here you can define a custom success message, or choose to not show a success message, whatever suits your needs.
By default, all forms filter HTML so as to prevent hackers from injecting malware into your website. If you wish to turn this feature off and allow users to submit HTML, simply turn on “Allow Unfiltered HTML”. Be careful to only turn this on if you trust everyone who is using this form!
This is where we limit which kinds of users can access the form. It is very important to configure this correctly, as otherwise, your users might not be able to see the form at all!
By default, only administrators can see the form. If you want to allow other users to access it, you need to add rule or configure the default rule. You can limit the visibility based on roles using the “Select By Role” option, or add specific users under the “Select By User” option.
Here you can specify the post type created by the form. It can be a Post, a Page, or any custom post type you might have created.
Here you can choose to show the entire form inside of a modal window which can be opened by clicking a button.
At any point you can preview your form. You may choose to show the form page to the public, keep it private for internal use, or you may set it to be password protected.
That’s it! You now have your very own New Post Form. Your live form should look something like this:
The end-user can now easily create posts with custom post types, add a featured image, and select the Category, all without touching the backend WordPress dashboard.