我正在为 WordPress 制作一个自定义选项页面并使用 wp_editor。这是我的代码:
$settings = array('wpautop' => false, 'textarea_name' => $editor_id);
echo '<table class="form-table">';
echo '<tbody>';
echo '<tr>';
echo '<th scope="col">Enabled?</th>';
echo '<td><input name="emp_enabled" type="checkbox" value="checked" '.$get_settings['emp_enabled'].'><p class="description">Do you want to enable Maintenance Page?</p></td>';
echo '</tr>';
echo '<tr>';
echo '<th scope="col">Background Colour</th>';
echo '<td><input id="emp_background_colour" class="regular-text ltr emp_background_colour" name="emp_background_colour" type="input" value="'.$get_settings['emp_background_colour'].'"><p class="description">Do you want to set a background colour?</p></td>';
echo '</tr>';
echo '<th scope="col">Background Image </th>';
echo '<td><input id="upload_image_url" class="regular-text ltr" name="emp_background_image" type="input" value="'.$get_settings['emp_background_image'].'"><input id="upload_image_button" class="button" type="button" value="Upload Image" /><p class="description">Do you want to set a background image? This will override Background Colour.</p></td>';
echo '</tr>';
echo '<tr>';
echo '<th scope="col">Content</th>';
echo '<td>'.wp_editor( $get_settings[$editor_id] , $editor_id, $settings ).'</td>';
echo '</tr>';
echo '</tbody>';
echo '</table>';
内容按应有的方式通过,但由于某种原因,编辑器不在表格单元格内,它位于实际表格的上方。
任何想法为什么会这样?我看不到任何明显的问题,所以如果我缺少某个设置,我会在徘徊吗?