我终于找到了向Sites>Infos表添加更多行的方法:
虽然有点难看,但它确实管用。我只是简单地使用动作admin_footer
在页面末尾添加一组HTML代码,然后使用jQuery将其移动到正确的位置。
add_action(\'admin_footer\', \'user16975_custom_options\');
function user16975_custom_options(){
global $pagenow;
if( \'site-info.php\' == $pagenow ) {
?><table><tr id="user16975_custom_options">
<th scope="row">My own option</th>
<td><input type="text"/></td>
</tr></table>
<script>jQuery(function($){
$(\'.form-table tbody\').append($(\'#user16975_custom_options\'));
});</script><?php
}
}
好的方面是,只要钩子可用,我就可以使用它,而无需对代码进行重大更改。