I do most of my development in Drupal. However I'm working on a Wordpress site and I need to make a form.
Which got me thinking: Is there something like a Form API for WordPress like there is in Drupal? Is there a way to add a standardized form by using PHP?
I do most of my development in Drupal. However I'm working on a Wordpress site and I need to make a form.
Which got me thinking: Is there something like a Form API for WordPress like there is in Drupal? Is there a way to add a standardized form by using PHP?
Share Improve this question edited Feb 15, 2019 at 12:23 norman.lol 3,2613 gold badges30 silver badges35 bronze badges asked Apr 8, 2012 at 19:38 Kelly HaysKelly Hays 1231 silver badge6 bronze badges 06 Answers
Reset to default 8No, but it should ;)
There are several custom field class's (backend).
- wpAlchemy : https://github/farinspace/wpalchemy
- Meta Box Script: https://github/rilwis/meta-box
- My-Meta-Box: https://github/bainternet/My-Meta-Box
- meta-box-class: https://github/corycrowley/meta-box-class
- Meta Boxes Class: https://github/Bakke/Wordpress-Custom-Meta-Boxes-Class
For front-end forms, you probably best off with a plugin in Eugene Manuilov's link.
There is no Form API. Try to use plugin for it. Find it here: wordpress/extend/plugins/search.php?q=form
Another custom field library:
Custom Metaboxes and Fields for WordPress
https://github/jaredatch/Custom-Metaboxes-and-Fields-for-WordPress
A lot of the 'free' form plugins in the repo are very limited in functionality, but there are options:
GravityForms
http://www.gravityforms/
NinjaForms
http://wpninjas/plugins/ninja-forms/
I might as well throw my hat into this ring. This plugin provides an API very similar to the Drupal forms API, and is great for general purposes form generation and processing.
https://github/oomphinc/WP-Forms-API
You can also see:
WP Forms API https://github/jbrinley/wp-forms
Momtaz Nmwdhj http://wordpress/plugins/momtaz-nmwdhj/
As of May 2017, there is no formal Forms API in the wordpress core.
There is the Fields API proposal that is working towards having a standard library for defining form fields.
The repo for the library can be found here:
https://github/sc0ttkclark/wordpress-fields-api
Although this library is in an alpha state, and not recommended for production.
There is a discussion of the issues here:https://torquemag.io/2016/02/wordpress-needs-fields-api-use/
Now wordpress is moving towards a more REST API driven admin area, I think that this Fields API is an important step to standardising the Wordpress back end, which to be honest desperately needs it.
Until then the best option is to use one of the plugins mentioned in the other answers.