dougaicha5258 2016-10-24 07:03
浏览 26

在短代码中添加多个属性:wordpress

I need to convert a core php script to wordpress plugin with shortcodes so non-technicle people can also perform same task easily using the shortcodes. In script, there are lots of functions and each function has many attributes so I am not able to understand how to do that part correctly.

$pdocrud = new PDOCrud();
$pdocrud->fieldTypes("about_yourself", "textarea");//change about_yourself 'textarea' to input type text
$pdocrud->fieldTypes("gender", "radio");//change gender to radio button
$pdocrud->fieldDataBinding("gender", array("male","female"), "", "","array");//add data for radio button
$pdocrud->fieldTypes("hobbies", "checkbox");//change hobbies to checkbox button
$pdocrud->fieldDataBinding("hobbies", array("Dance","Art","Games"), "", "","array");//add data for checkbox button
$pdocrud->fieldTypes("state", "select");//change state to select dropdown
$pdocrud->fieldDataBinding("state", array("Andhra Pradesh","Bihar","Patna","Gujarat","Madhya Pradesh"), "", "","array");//add data using array in select dropdown
$pdocrud->fieldTypes("country", "multiselect");//change country to multiselect dropdown
$pdocrud->fieldDataBinding("country", array("India","Brazil","UK","Pakistan"), "", "","array");//add data using array in multiselect
echo $pdocrud->dbTable("users")->render("insertform");

Here you can find more details about the script. Only thing I need to do is to convert the script functions in wordpress shortcode. I am able to do it using only eval function but since it is not secure so please suggest some better way. Please note that object of class is used here.

Thanks

  • 写回答

1条回答 默认 最新

  • dqq9695 2016-10-24 07:23
    关注

    as far as I can tell the best option for you would be to use this plugin: Wordpress Types Toolset

    评论

报告相同问题?

悬赏问题

  • ¥15 我这模型写的不对吗?为什么lingo解出来的下面影子价格这一溜少一个变量
  • ¥50 树莓派安卓APK系统签名
  • ¥15 maple软件,用solve求反函数出现rootof,怎么办?
  • ¥65 汇编语言除法溢出问题
  • ¥15 Visual Studio问题
  • ¥20 求一个html代码,有偿
  • ¥100 关于使用MATLAB中copularnd函数的问题
  • ¥20 在虚拟机的pycharm上
  • ¥15 jupyterthemes 设置完毕后没有效果
  • ¥15 matlab图像高斯低通滤波