bulk actions action
-
Hello, I’m learning how to make plugins and I’m running into some difficulty. I’m trying to modify the bulk actions dropdown under the post and pages parts of admin. I managed to get the dropdown to display a new name but I can’t get it to do anything – not even output a simple “Hello World”. I’m quite lost and was hoping someone could help me. Here’s what I have currently:
function mycustom_bulk_action( $bulk_actions ) { $bulk_actions[ 'mycustom_bulk' ] = __( 'My Custom Bulk Action', 'mycustom_posts_status' ); return $bulk_actions; } add_filter( 'bulk_actions-edit-post', 'mycustom_bulk_action' ); add_filter( 'bulk_actions-edit-page', 'mycustom_bulk_action' ); function mycustom_bulk_action_handler( $redirect_to, $action_name, $post_ids ) { if ( $doaction !== 'mycustom_bulk_action' ) { return $redirect_to; } foreach ( $post_ids as $post ) { echo "hello world"; } return $redirect_to; } add_filter( 'handle_bulk_actions-edit-post', 'mycustom_bulk_action_handler' );
- This topic was modified 7 years, 4 months ago by . Reason: added the add_filter that I forgot. Still doesn't work. :(
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘bulk actions action’ is closed to new replies.