admin管理员组文章数量:1122846
so... this is a brand new chapter for me, i've googled for a solution and found loads but nothing working for me unfortunately.
function column_title($item){
$actions = array(
'edit' => sprintf('<a href="?page=%s&action=%s&ID=%s">Edit</a>',$_REQUEST['page'],'edit',$item['ID']),
'delete' => sprintf('<a href="?page=%s&action=%s&ID=%s">Delete</a>',$_REQUEST['page'],'delete',$item['ID']),
);
return sprintf('%1$s %2$s', $item['ID'], $this->row_actions($actions) );
}
above i've added a delete and edit action, and i think i've used the sprintf the proper way but i'm not sure, database table contains the following columns ID, usr_id, date, begin, end, pause, egenb, tot, and asum i want my actions to select the rows by ID so is my code above correct?
function column_cb($item) {
return sprintf(
'<input type="checkbox" name="ID[]" value="%s" />', $item['ID']
);
}
above is my check box, normally name="book[]" can someone explain what the purpose of the [] is?
function process_bulk_action() {
//Detect when a bulk action is being triggered...
if( 'delete'===$this->current_action() ) {
wp_die('Items deleted (or they would be if we had items to delete)!');
}
}
and last we got process_bulk_action where the delete action and edit action is to take place is there a kind person out there that can explain how i would go about this? i'm not just seeking a quick answer but understanding of it, i've tried with loads of things i found thru google but none made the slightest effect nor did it make any sense to me
in advance thanks to anyone taking the time to read thru my post! :)
so... this is a brand new chapter for me, i've googled for a solution and found loads but nothing working for me unfortunately.
function column_title($item){
$actions = array(
'edit' => sprintf('<a href="?page=%s&action=%s&ID=%s">Edit</a>',$_REQUEST['page'],'edit',$item['ID']),
'delete' => sprintf('<a href="?page=%s&action=%s&ID=%s">Delete</a>',$_REQUEST['page'],'delete',$item['ID']),
);
return sprintf('%1$s %2$s', $item['ID'], $this->row_actions($actions) );
}
above i've added a delete and edit action, and i think i've used the sprintf the proper way but i'm not sure, database table contains the following columns ID, usr_id, date, begin, end, pause, egenb, tot, and asum i want my actions to select the rows by ID so is my code above correct?
function column_cb($item) {
return sprintf(
'<input type="checkbox" name="ID[]" value="%s" />', $item['ID']
);
}
above is my check box, normally name="book[]" can someone explain what the purpose of the [] is?
function process_bulk_action() {
//Detect when a bulk action is being triggered...
if( 'delete'===$this->current_action() ) {
wp_die('Items deleted (or they would be if we had items to delete)!');
}
}
and last we got process_bulk_action where the delete action and edit action is to take place is there a kind person out there that can explain how i would go about this? i'm not just seeking a quick answer but understanding of it, i've tried with loads of things i found thru google but none made the slightest effect nor did it make any sense to me
in advance thanks to anyone taking the time to read thru my post! :)
Share Improve this question edited May 13, 2015 at 13:51 Alexander asked May 13, 2015 at 13:04 AlexanderAlexander 571 silver badge11 bronze badges 1- Did you find a solution to this how you can delete a row? – CompactCode Commented May 3, 2017 at 8:59
1 Answer
Reset to default 0above is my check box, normally name="book[]" can someone explain what the purpose of the [] is?
This is allowing the checked values to be returned as an array when getting the results, if you have more than one value checked.
Besides that, I can't tell what you're trying to do in order to be able to answer the other questions. Especially the last part. It appears like you're asking someone to write the code for you, for process_bulk_action()? There's not enough specific question to answer.
本文标签: pluginscustomlisttable editdelete bulk actions
版权声明:本文标题:plugins - custom_list_table editdelete bulk actions 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736281262a1926263.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论