WordPress User Submitted Posts - Use Case - How To Add Advanced Custom Fields (ACF) Into the Submission Form
How To Add Advanced Custom Fields (ACF) Into the Submission Form
Note: This guide requires:
- WordPress User Submitted Posts - This document uses version 2.3.5
- Advanced Custom Fields - This document uses version 5.12.2
Introduction
WordPress User Submitted Posts is a plugin that allows logged in users submit posts, review drafts and upload images via a customizable form. Update and moderate their content and provide writing tips.
Use Case Front-End
Custom fields added into the submission form:
Adding content to the submission form and filling custom fields:
Custom fields added into the post:
Use Case Assumptions
In this example use case guide we will consider how to add custom fields from the plugin Advanced Custom Fields (ACF) into the submission form to let users add extra information.
We consider that you have already bought the plugin, but not installed it yet.
It follows:
- Installing the plugin
- Quick recap
- Creating custom fields
- Adding custom fields into the submission form
- End result
Installing the Plugin
The process is the same for all CM plugins and add-ons.
- Download the plugin from your customer dashboard.
- Log in to WordPress and navigate to the WordPress Admin → Plugins settings.
- Click on Add New.
- Activate it and add the license.
Learn more: Getting Started - Plugin Overview
Quick Recap
In this example use case guide we will consider only how to add custom fields from the plugin Advanced Custom Fields to the submission form. We will not consider the whole process of configuring the plugin WordPress User Submitted Posts and how to enable the submission form. You can learn more about it in this use case guide: WordPress User Submitted Posts - Use Case - How to Let Your Users Submit Posts Without Accessing the Site Backend
Creating Custom Fields
First of all, we need to create a group of custom fields that we want to add into the submission form. You can refer to the documentation of the plugin Advanced Custom Fields to learn more about how to create a group of custom fields.
We've created for our use case a few URL fields for adding links to external resources:
Locate the key of the created field group, as we will need it for adding into the submission form.
Important Note
Currently, only the following field types are supported by the plugin WordPress User Submitted Posts:
- Text
- Textarea
- URL
- Image
- WYSIWYG editor
Adding Custom Fields Into the Submission Form
Adding custom fields into the submission form can be done by using the shortcode [add_post_form] with the parameter acf_field_group_key, where you should pass the key of the group of fields.
In our case the shortcode will be:
[add_post_form acf_field_group_key="group_61e411e495be9"]
Now let's put this shortcode to the post and click Publish / Edit.
Now the submission form will have additional fields for adding external resources:
Reminder
If you want your users to be able to edit their posts, you need the page that contains a shortcode for displaying the submission form to be set as an Editor Page. You can find this option by navigating to CM User Submitted Posts → Settings → General Settings tab.
TIP
Learn more about how to display custom fields on the front-end in the documentation of the Advanced Custom Fields plugin: Displaying values in your theme
End Result
Following instructions found in the plugin and guides, you should be able to add custom fields from the plugin Advanced Custom Fields (ACF) into the submission form to let users add extra information.
Use Case Front-End
Custom fields added into the submission form:
Adding content to the submission form and filling custom fields:
Custom fields added into the post:
More information about the WordPress User Submitted Posts plugin Other WordPress products can be found at CreativeMinds WordPress Store |
|
Let us know how we can Improve this Product Documentation Page To open a Support Ticket visit our support center |