当我尝试将表单插入thickbox以用于管理区域时,它似乎被完全删除了。我需要改变什么?
<?php
// Enqueue thickbox js and css
add_thickbox();
?>
<div style="text-align:center;padding:20px 0;">
<input alt="#TB_inline?width=500&height=600&inlineId=examplePopup1" title="Insert/edit link" class="thickbox" type="button" value="Tickbox 1" />
</div>
<div id="examplePopup1" style="display: none">
<div name="buffer">
<form name="test" action="www.test.php" method="post">
<input type="text" class="item-permalink" value="test">
<input type="submit" value="Add Link" class="button button-primary" id="link_form-submit" name="link_form-submit">
</form>
</div>
</div>
在浏览器中,我只需
<div id="examplePopup1" style="display: none">
<div name="buffer">
<input type="text" class="item-permalink" value="test">
<input type="submit" value="Add Link" class="button button-primary" id="link_form-submit" name="link_form-submit">
</div>
</div>
SO网友:Hubert Popp
现在有点晚了,但不管怎样,这可能会有所帮助。我通过过滤器将thickbox div添加到“admin\\u footer”中解决了这个问题。如果这样做,则代码在常规表单之外。
好的,下面是我如何添加表单的代码:
<?php
add_filter(\'admin_footer-edit.php\', \'expose_form\');
function expose_form(){
?>
<div id="expo" style="display:none;" >
<h3>Andruck wählen</h3>
<div class="form">
<table class="expformtable">
<form action="" method="post" class="expgen">
<input type="hidden" class="id" name="id" value="">
<tr>
<th>Andrucken</th>
<th>Seite</th>
</tr>
<tr>
<td><input type="checkbox" name="titlepage" value="titlepage" checked="true"></td>
<td><label for="titlepage">Titelseite andrucken</label>
<ul>
<li><input type="checkbox" name="grayscale" value="grayscale"> Graustufenbilder</li>
</ul>
</td>
</tr>
<tr>
<td><input type="checkbox" name="detailpage" value="detailpage" checked="true"></td>
<td><label for="titlepage">Detialsseite andrucken</label>
<ul>
<li><input type="radio" name="adaptiveheight" value="adaptive" checked="true"> Adaptive Zeilenhöhe</li>
<li><input type="radio" name="adaptiveheight" value="fixed"> Fixe Zeilenhöhe</li>
</ul>
</td>
</tr>
<tr>
<td><input type="checkbox" name="mappage" value="mappage" checked="true"></td>
<td><label for="titlepage">Karte andrucken</label></td>
</tr>
<tr>
<td><input type="checkbox" name="textpage" value="textpage" checked="true"></td>
<td><label for="titlepage">Textseiten andrucken</label></td>
</tr>
<tr>
<td><input type="checkbox" name="picpage" value="picpage" checked="true"></td>
<td><label for="titlepage">Bildseiten andrucken</label></td>
</tr>
<tr>
<td><input type="checkbox" name="agbpage" value="agbpage" checked="true"></td>
<td><label for="titlepage">AGB Seite andrucken</label></td>
</tr>
<tr>
<td><input type="checkbox" name="docpage" value="docpage" checked="true"></td>
<td><label for="titlepage">Mieterliste andrucken</label></td>
</tr>
<tr>
<td><input type="text" name="imagequality" value="30"></td>
<td><label for="imagequality">Bildqualität %</label><p>100 = Originalbilder 0 = kleinste Dateigröße</p></td>
</tr>
<tr>
<td colspan="2"> <input type="submit" class="button-primary" value="genereieren"></td>
</tr>
</form>
</table>
</div>
<div class="ajaxloading">
<div class="spinner"></div>
</div>
</div>
<?php
}
这只是通过admin\\u footer filter the-edit添加的一个简单表单。php sufix确保它只添加在post页面上。