11

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?

7

No, but it should ;)

There are several custom field class's (backend).

For front-end forms, you probably best off with a plugin in Eugene Manuilov's link.

3

There is no Form API. Try to use plugin for it. Find it here: wordpress.org/extend/plugins/search.php?q=form

1

Another custom field library:

Custom Metaboxes and Fields for WordPress

https://github.com/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.com/

NinjaForms

http://wpninjas.net/plugins/ninja-forms/

1

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.com/oomphinc/WP-Forms-API

0

You can also see:

WP Forms API https://github.com/jbrinley/wp-forms

Momtaz Nmwdhj http://wordpress.org/plugins/momtaz-nmwdhj/

0

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.com/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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.