$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>metabox - Does Wordpress have a "Form API"?|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

metabox - Does Wordpress have a "Form API"?

matteradmin8PV0评论

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 0
Add a comment  | 

6 Answers 6

Reset to default 8

No, 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.

Post a comment

comment list (0)

  1. No comments so far