WP_Plugins_List_Table::get_bulk_actions()protectedWP 1.0

Method of the class: WP_Plugins_List_Table{}

No Hooks.

Return

Array.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_bulk_actions();

Notes

  • Global. String. $status

WP_Plugins_List_Table::get_bulk_actions() code WP 6.5.2

protected function get_bulk_actions() {
	global $status;

	$actions = array();

	if ( 'active' !== $status ) {
		$actions['activate-selected'] = $this->screen->in_admin( 'network' ) ? _x( 'Network Activate', 'plugin' ) : _x( 'Activate', 'plugin' );
	}

	if ( 'inactive' !== $status && 'recent' !== $status ) {
		$actions['deactivate-selected'] = $this->screen->in_admin( 'network' ) ? _x( 'Network Deactivate', 'plugin' ) : _x( 'Deactivate', 'plugin' );
	}

	if ( ! is_multisite() || $this->screen->in_admin( 'network' ) ) {
		if ( current_user_can( 'update_plugins' ) ) {
			$actions['update-selected'] = __( 'Update' );
		}

		if ( current_user_can( 'delete_plugins' ) && ( 'active' !== $status ) ) {
			$actions['delete-selected'] = __( 'Delete' );
		}

		if ( $this->show_autoupdates ) {
			if ( 'auto-update-enabled' !== $status ) {
				$actions['enable-auto-update-selected'] = __( 'Enable Auto-updates' );
			}
			if ( 'auto-update-disabled' !== $status ) {
				$actions['disable-auto-update-selected'] = __( 'Disable Auto-updates' );
			}
		}
	}

	return $actions;
}