You can define more than one bulk action in this function because it merely adds an additional element to the array $bulk_actions. You simply have to take care that you use different names for the element keys and, logically, for the display texts.

As mentioned above you can define more than one custom bulk action but only a single callback function. So you first have to test which bulk action has been selected (lines 4 and 13).

Next the posts are processed in a foreach loop (lines 5 and 14). In this loop you can load the post with get_post or the post meta with get_post_meta() and process the data. Next the changed data is written back to the database with wp_update_post() or update_post_meta().

The variable $redirect_to (lines 9 and 18) is used to define the URL the browser will change to after the bulk actions have been completed, in our case it is set to .../wp-admin/edit.php?paged=1. We do not want to change the location but to use the variable to pass a value to the page the browser is redirected to.
With the function add_query_arg() we add an argument to the URL that specifies the number of processed posts: /wp-admin/edit.php?paged=1&bulk_posts_processed=1.

Display a success notification

After completing processing all posts you can display an admin notice using the action admin_notices(). The second parameter of the function call needs to contain the text string we have defined in our filter bulk_actions-{screen-id}: