Welcome to ACF Front Form Elementor’s documentation

_images/title.jpg

By : Mourad Arifi Email : arifi.armedia@gmail.com

Make Front end Forms with Advanced Custom Fields using Elementor Page Builder or shortcode without extra coding or hooking to use acf_form() function, just add a shortcode with all needed paramerters.

Guide

What’s New in Version 2.0

The version 2.0 has beed released in 02-01-2020 whith these new features :

Added Authorizations

This, as it says, allows you to define who can see and use the form, it has 3 types :
  • Logged in : wheither or not to display the form for guesses or only logged in users
  • Roles : you can choose which roles has ability to use the form
  • Users : whith this option, you can select specific users which can see and use the form

You can see more details at Authorization Settings section.

Added Elementor UI Style Tabs

This new feature was largely asked by many users and we are proud to bring it ! here some of all styles that may be done in Elementor Style Tab :
  • Ability to style Form, Fields, Inputs and Submit Button
  • Ability to style Wordpress contant buttons
  • Ability to set Typography, Text Color and Text shadow
  • Ability to set Margin, Padding, Box Shadow and Borders for all elements (or most of them)
  • Slider for Label width
  • Custom style for Normal and Hover with transition duration
  • Add new post swith option

Due to complexity of all possible customizations, we provided only the must have features, and more style settings are coming in the future.

New Enclosed shortcodes for further releases

Some of the old attributes of the shortcode causes some issues, so we have moved them outside the main shortcode and made them enclosed shortcode. In this way, more advanced settings may be used whithout causing any conflicts, you can see those new shortcodes in HTML Settings section. These new shortcodes are not implemented in Elementor UI for the moment and will be included in next update.

Finally, some other fixes and code optimizations was done. We hope that whith this new release all our users of the plugin will find a better way to achieve their goal. Many other features are coming soon :)

Requirements

  • Advanced Custom Fields

ACF Front Form uses functions of Advanced Custum Fields version 5.6.7 You can get the fee version on GitHub

Nice to have

  • Elementor Page Builder

Since shortcodes are processed by WordPress, ACF Fron Form Elementor works without Elementor For a better experience, it’s recomanded to have Elementor installed

Installation

Download

You can get the latest version of ACF Front Form Elementor from :

  1. CodeCanyon at this Link

Using Wordpress Plugin Manager

  1. On the Plugin menu click on Add New
  2. Then click on Upload Plugin then Chose a file to upload
  3. Click on Install Now
  4. After the plugin is installed, click on Activate

Using FTP

  1. Download ACF Front Form Elementor Plugin to your desktop.
  2. Extract the Plugin folder to your desktop.
  3. With your FTP program, upload the Plugin folder to the wp-content/plugins folder in your WordPress directory online.
  4. Go to Plugins screen and find ACF Front Form Elementor Plugin in the list.
  5. Click Activate to activate it.

Quick Starter Guid

Warning

Before creating any form, make sure you have Advanced Custom Fields installed and activated

In this starter guid, we’ll create a form which creates a post with extra fields related to a book. These fields are :

  • Book’s ISBN
  • Book’s Author
  • Date of publication

Creating The Fields

First of all, we need to create those extra fields using Advanced Custom Fields (ACF), to do so, in the ACF menu click on “Add New”, this will create a new Fields Group which we’ll call “About the book”.

Then, add the fields using the button “Add Field” :

Label Name Type
ISBN isbn Text
Author author Text
Date of publication date_of_publication Date Picker

When you have done, click on “Publish”. Now the fields are ready to use.

_images/about-book.jpg

Adding the form into a page

Now we have a ACF Fields Group, we can add a form into any page in our website, let’s create a page in Wordpress and call it “Books Reviw”.

  • In this page, click on Edit with Elementor
  • From the Elementor panel, find the ACF Form element under the ACF Front Form group
_images/drag_drop.jpg
  • In the Post section, make sure that the Create New Post is set to Yes, this means that each time a user submits the form, a new post will be created
_images/new_post.jpg
  • Now, in the Form section, find the Submit Value and set it to Submit, this is the text displayed on the submit button of the Form
_images/submit.jpg
  • You can now Save the settings and preview your page
_images/form.jpg

Add a specific form

In some situations, you can have multiple Fields Groups of ACF, in this case we need to tell ACF Front Form to load only our specific Fields Group. To do so, go to ACF Front Form Elementor settings of your page, in the Fields section, in the Field Groups field, check the the group you want to use.

_images/fields.jpg

Tip

If you want to add the title and content fields into the Form, then check the two options Show the title and Show the content

Save changes and that’s it !

_images/form_title.jpg

Adding a Form

Warning

Before creating any form, make sure you have used Advanced Custom Fields to create fields

Using Elementor

Use Elementor or manually add shortcode [acf_front_form] where you want your form to be displayed

_images/el.jpg

The ACF Front Form Settings are then displayed (or select the ACF Front Form Element in your page)

_images/post-att.jpg

For more information about Elementor settings, see attributes.

Using Shortcode

To add a form in a page or a post, add the fellowing shortcode where you want the form be rendered

[acf_front_form]
Examples
  • Creating and publishing a new post
[acf_front_form post_id="new_post" np_title="Yay" np_type="post" np_status"=publish"]

Or

[acf_front_form post_id="new_post" new_post="post_title=Yay post_type=post post_status=publish"]
  • Load title, content and all fields of a specific post into a form
[acf_front_form post_id="31" post_title="Yes" post_content="Yes"]
  • Create a form using a specific Field Groups
[acf_front_form field_groups="group_5a6ce38c5d036"]

Or

[acf_front_form field_groups="949"]

Attributes

ACF Front Form Elementor creates [acf_front_form] shortcode whith attributes. this shortcode call the acf_form() function which renders the form, most of this attributes corresponds to a parameter of the acf_form() function, for more information about acf_form() function, read this documentation

Note

The attributes explained here are used by ACF Front Form Elementor shortcode

Post Settings

Defines the $post values, they are all mapped to acf_form() function. You can find here all variables of the WP_Post class

_images/post-att.jpg
Shortcode attributes
Attribute Type/Values Default Description
post_id int, string Current post ID The post ID to load data from and save data to. Can also be set to “new_post” to create a new post on submit
np_title string   The title of the new post
np_status string   The status of the new post
np_type string   The post type of the new post
new_post array   A list of post data separated with commas used to create a post. See wp_insert_post for available parameters. The above post_id setting must contain a value of “new_post”

Form Settings

Defines the settings of the rendered form, they are all mapped to acf_form() function

_images/form-att.jpg
Shortcode attributes
Attribute Type/Values Default Description
form checkbox Yes Whether or not to create a form element. Useful when adding to an existing form
id string acf-form The id of the form element
form_attributes string   A list of HTML attributes for the form element
return string current url The URL to be redirected to after the form is submit, more details here
submit_value string Update The text displayed on the submit button
updated_message string Post updated A message displayed above the form after being redirected. Empty for no message
kses checkbox Yes Whether or not to sanitize all $_POST data with the wp_kses_post() function. Defaults to true

Fields Settings

Defines settings related to the fields, they are all mapped to acf_form() function

_images/fields-att.jpg
Shortcode attributes
Attribute Type/Values Default Description
post_title checkbox   Whether or not to show the post title text field
post_content checkbox   Whether or not to show the post content editor field
field_groups array   A list of group IDs/keys separated with commas to override the fields displayed in this form
fields array   A list of field IDs/keys separated with commas to override the fields displayed in this form
label_placement top, left top Determines where field labels are places in relation to fields
instruction_placement label, field label Determines where field instructions are places in relation to fields
field_el div, tr, td, ul, ol, dl div Element used to wrap the fields
uploader wp, basic wp Whether to use the WP uploader or a basic input for image and file fields
honeypot checkbox Yes Whether to include a hidden input field to capture non human form submission

Authorization Settings

In this section, you can define who can see and use the form.

_images/auth-att.jpg
Authorization Attributes
Attribute Type/Values Default Description
logged_in checkbox false If set to ‘Yes’ only logged in users will be able to see and use the form Extra HTML to add before the fields
roles array   Comma separated names of the Wordpress roles that can see and use the form Extra HTML to add after the fields
users array   Comma separated IDs of Wordpress users that can see and use the form

HTML Settings

Note

since the version 2.0, all html attributes are deprecated and replaced by enclosed shortcodes

With these settings related to HTML, you can customize HTML related to the ACF Form, they are all mapped to acf_form() function.

HTML Shortcodes
Shortcode Type/Values Default Description
[before_fields] string   Extra HTML to add before the fields
[after_fields] string   Extra HTML to add after the fields
[updated_message] string <div id=”message” class=”updated”><p>%s</p></div> HTML used to render the updated message
[submit_button] string <input type=”submit” class=”acf-button button button-primary button-large” value=”%s” /> HTML used to render the submit button
[submit_spinner] string <span class=”acf-spinner”></span> HTML used to render the submit button loading spinner
Example

This shortcode sample will customize the update message and the submit button

[acf_front_form post_id="new_post"]
   [updated_message]
      <div id="message" class="updated"><span>%s</span></div>
   [/updated_message]
   [submit_button]
      <input type="submit" class="my-class acf-button button button-primary button-small" value="%s" />
   [/submit_button]
[/acf_front_form]

Table Settings

When the field_el is set to td or tr, the acf_form() function will not add the table tags ( read more ) ACF Front Form will do the job for you if you want, to do so, Check the * Add the table tags * .. note:: These attributes are not part of the acf_form() function

_images/table-att.jpg
Shortcode attributes
Attribute Type/Values Default Description
table_el checkbox   Whether or not to add table tags before and after the fields, field_el should be set to td or tr
thead string   Comma separated text added into td tags of the thead tag if the table_el is checked, to use default field labels,set this attribute to ‘@’
tfoot string   Comma separated text added into td tags of the tfoot tag if the table_el is checked, to use default field labels,set this attribute to ‘@’

Settings

In the Settings menu of Wordpress click on ACF Front Form

_images/acf_ff_settings.jpg

acf_form_head()

This function is used to process, validate and save the submitted form data created by the acf_form() function. It will also enqueue all ACF related scripts and styles for the acf form to render correctly. Read the documentation

Disable this function if you have added acf_form_head() manually or using another plugin

acf_enqueue_uploader()

This will create a hidden WYSIWYG field and enqueue the required JS templates for the WP media popups

Disable this function if you have added acf_enqueue_uploader() manually or using another plugin

Inline JS

This will allow ACF to initialize the fields within the newly added HTML. Read the documentation

Disable this function if you have added the inline JS manually or using another plugin

License

GNU GENERAL PUBLIC LICENSE Version 2, June 1991

Copyright (C) 1989, 1991 Free Software Foundation, Inc.51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA

Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.

Preamble

The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software–to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation’s software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too.

When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.

To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.

For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.

We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.

Also, for each author’s protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors’ reputations.

Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone’s free use or not licensed at all.

The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

  1. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The “Program”, below, refers to any such program or work, and a “work based on the Program” means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term “modification”.) Each licensee is addressed as “you”.

Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.

  1. You may copy and distribute verbatim copies of the Program’s source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.

You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.

  1. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:

    a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)

These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.

Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.

In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.

  1. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:

    a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)

The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.

If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.

  1. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
  2. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
  3. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients’ exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
  4. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.

If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.

It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.

This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.

  1. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
  2. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.

Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and “any later version”, you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.

  1. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.

NO WARRANTY

  1. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
  2. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

Indices and tables