Title: WP_Posts_List_Table::get_bulk_actions
Published: April 25, 2014
Last modified: August 20, 2026

---

# WP_Posts_List_Table::get_bulk_actions(): array

## In this article

 * [Return](https://developer.wordpress.org/reference/classes/wp_posts_list_table/get_bulk_actions/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/wp_posts_list_table/get_bulk_actions/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/wp_posts_list_table/get_bulk_actions/?output_format=md#related)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_posts_list_table/get_bulk_actions/?output_format=md#wp--skip-link--target)

## 󠀁[Return](https://developer.wordpress.org/reference/classes/wp_posts_list_table/get_bulk_actions/?output_format=md#return)󠁿

 array

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_posts_list_table/get_bulk_actions/?output_format=md#source)󠁿

    ```php
    protected function get_bulk_actions() {
    	$actions       = array();
    	$post_type_obj = get_post_type_object( $this->screen->post_type );

    	if ( current_user_can( $post_type_obj->cap->edit_posts ) ) {
    		if ( $this->is_trash ) {
    			$actions['untrash'] = __( 'Restore' );
    		} else {
    			$actions['edit'] = _x( 'Bulk edit', 'verb' );
    		}
    	}

    	if ( current_user_can( $post_type_obj->cap->delete_posts ) ) {
    		if ( $this->is_trash || ! EMPTY_TRASH_DAYS ) {
    			$actions['delete'] = __( 'Delete permanently' );
    		} else {
    			$actions['trash'] = __( 'Move to Trash' );
    		}
    	}

    	return $actions;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-posts-list-table.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-admin/includes/class-wp-posts-list-table.php#L432)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/class-wp-posts-list-table.php#L432-L453)

## 󠀁[Related](https://developer.wordpress.org/reference/classes/wp_posts_list_table/get_bulk_actions/?output_format=md#related)󠁿

| Uses | Description | 
| [current_user_can()](https://developer.wordpress.org/reference/functions/current_user_can/)`wp-includes/capabilities.php` |

Returns whether the current user has the specified capability.

  | 
| [__()](https://developer.wordpress.org/reference/functions/__/)`wp-includes/l10n.php` |

Retrieves the translation of $text.

  | 
| [_x()](https://developer.wordpress.org/reference/functions/_x/)`wp-includes/l10n.php` |

Retrieves translated string with gettext context.

  | 
| [get_post_type_object()](https://developer.wordpress.org/reference/functions/get_post_type_object/)`wp-includes/post.php` |

Retrieves a post type object by name.

  |

[Show 2 more](https://developer.wordpress.org/reference/classes/wp_posts_list_table/get_bulk_actions/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/classes/wp_posts_list_table/get_bulk_actions/?output_format=md#)

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_posts_list_table%2Fget_bulk_actions%2F)
before being able to contribute a note or feedback.