Does WordPress have a “Form API”?

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?

Related posts

Leave a Reply

6 comments

  1. 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.

  2. 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.