我的大部分开发都是在Drupal中完成的。然而,我正在Wordpress网站上工作,我需要制作一个表单。
这让我思考:是否有类似于Drupal中的WordPress表单API的东西?有没有办法使用PHP添加标准化表单?
我的大部分开发都是在Drupal中完成的。然而,我正在Wordpress网站上工作,我需要制作一个表单。
这让我思考:是否有类似于Drupal中的WordPress表单API的东西?有没有办法使用PHP添加标准化表单?
不,但应该;)
有几个自定义字段类(后端)。
炼金术:https://github.com/farinspace/wpalchemy https://github.com/rilwis/meta-boxhttps://github.com/bainternet/My-Meta-Boxhttps://github.com/corycrowley/meta-box-classhttps://github.com/Bakke/Wordpress-Custom-Meta-Boxes-Class
没有表单API。尝试使用插件。在此处查找:wordpress.org/extend/plugins/search.php?q=form
另一个自定义字段库:
Custom Metaboxes and Fields for WordPress
https://github.com/jaredatch/Custom-Metaboxes-and-Fields-for-WordPress
repo中的许多“免费”形式插件在功能上非常有限,但有以下几种选择:GravityForms
NinjaForms
我倒不如把帽子扔进这只戒指里。该插件提供了一个非常类似于Drupal表单API的API,非常适合一般用途的表单生成和处理。
您还可以看到:
WP Forms APIhttps://github.com/jbrinley/wp-forms
Momtaz Nmwdhj公司http://wordpress.org/plugins/momtaz-nmwdhj/
截至2017年5月,wordpress核心中没有正式的表单API。
有一个Fields API提案正在努力建立一个用于定义表单字段的标准库。
可在以下位置找到该库的repo:
https://github.com/sc0ttkclark/wordpress-fields-api
尽管此库处于alpha状态,但不建议用于生产。这里讨论了以下问题:https://torquemag.io/2016/02/wordpress-needs-fields-api-use/
现在wordpress正朝着一个更加REST API驱动的管理领域发展,我认为这个Fields API是标准化wordpress后端的一个重要步骤,老实说,它非常需要它。
在此之前,最好的选择是使用其他答案中提到的一个插件。
我正在使用本教程中WP tuts的元框http://wp.tutsplus.com/tutorials/reusable-custom-meta-boxes-part-3-extra-fields/ 一切正常,但我不知道如何调用图像上传程序的值。在我的索引中。php我使用了此代码<?php $image_upload = get_post_meta($post->ID, $field[\'custom_image\'], true);?> <?php print_r($im