我尝试了所有方法,但我不知道要删除 wordpress 表中的特定行。
有人请帮助如何删除表中的特定行,我正在做 wordpress 插件。
有人说用wpdb,但我不知道怎么做
这是我的代码
<table class="wp-list-table widefat fixed striped users" id="list" style="margin-top:10px;">
<tr>
<th class="center"><span>ID</span></th>
<th class="center"><span>Title</span></th>
<th class="center"><span>Action</span></th>
</tr>
<?php
if(!empty($event_list))
{
$arrlen = count($event_list);
for ($i=0; $i<$arrlen; $i++)
{
?>
<tr>
<td><?php echo $event_list[$i]['id'] ?></td>
<td><?php echo $event_list[$i]['title'] ?></td>
<td><a class="delete" href="<?php echo site_url();?>/wp-admin/admin.php?page=newslist">Delete</a></td>
</tr>
<?php
}
}
else
{
?>
<td>No Records Found</td>
<?php }?>
</table>
Run Code Online (Sandbox Code Playgroud) wordpress ×1