wework4web
wework4web

Reputation: 408

Filter bulk_actions-post not working in wordpress post screen

in wordpress *wp-admin/edit.php?post_type=post*, I tried to add a new bulk action that exports each post into custom xml for my other application. When i use the following code nothing happes. Can anyone help me to resolve this problem . These are the code that i wrote in 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');

Upvotes: 1

Views: 1354

Answers (1)

Eddie
Eddie

Reputation: 139

Try this instead:

add_filter('bulk_actions-edit-post','my_custom_bulk_actions');

The screen id you're looking for is "edit-post" not "post".

The Codex lists the screen-ids here: http://codex.wordpress.org/Plugin_API/Admin_Screen_Reference

Upvotes: 1

Related Questions