在wordpress * wp-admin / edit.php?post_type = post *,我尝试添加一个新的批量操作,将每个帖子导出到我的其他应用程序的自定义xml中。当我使用以下代码时,没有任何事情发生。任何人都可以帮我解决这个问题。这些是我在function.php
中编写的代码function my_custom_bulk_actions($actions){
$actions['custom_xml_export'] = "Export to XML";
return $actions;
}
function register_custom_bulk_action(){
add_filter('bulk_actions-post','my_custom_bulk_actions');
}
add_action('admin_init','register_custom_bulk_action');
答案 0 :(得分:1)
请改为尝试:
add_filter('bulk_actions-edit-post','my_custom_bulk_actions');
您正在寻找的屏幕ID是“编辑后”而非“发布”。
Codex在此处列出了屏幕ID:http://codex.wordpress.org/Plugin_API/Admin_Screen_Reference