我想在wordpress中顯示一個php表單。我被默認給出了下面的代碼(它表明它可以用來顯示自定義字段)並對其進行了編輯,但它仍然沒有顯示錶單:(我想弄清楚如何輕鬆地顯示這個,因爲我需要添加自定義字段和很新的PHP在PHP中顯示錶格
/*
* The form for adding custom fields on the options page.
*/
function fcpetition_fieldform($po) {
?>
<form method="post" action="<?php echo str_replace('%7E', '~', $_SERVER['REQUEST_URI']); ?>"/>
<input type="radio" name="addfield" value="yes"/>
<input type="dropdown" name="petition_select" value="<?php echo $po; ?>"/>
<input type="dropdown" name="editpetition" value="<?php print $po;?>">
Type: <select name = "fieldtype">
<option value="text">Text box</option>
<option value="select">Drop down box</option>
</select>
Name:<input type="text" name="fieldname"/>
Options:<input type="text" name="options"/>
Publish field <input type="checkbox" name="hide" checked/>
<input type="submit" name="Submit" value="<?php _e("Add","fcpetition")?>"/>
</form>
<?php
}
原始代碼的w/o我的編輯:
/*
* The form for adding custom fields on the options page.
*/
function fcpetition_fieldform($po) {
?>
<form method="post" action="<?php echo str_replace('%7E', '~', $_SERVER['REQUEST_URI']); ?>"/>
<input type="hidden" name="addfield" value="yes"/>
<input type="hidden" name="petition_select" value="<?php echo $po; ?>"/>
<input type="hidden" name="editpetition" value="<?php print $po;?>">
Type: <select name = "fieldtype">
<option value="text">Text box</option>
<option value="select">Drop down box</option>
</select>
Name:<input type="text" name="fieldname"/>
Options:<input type="text" name="options"/>
Publish field <input type="checkbox" name="hide" checked/>
<input type="submit" name="Submit" value="<?php _e("Add","fcpetition")?>"/>
</form>
<?php
}
函數調用被調用的表單嗎? –