PHPackages                             seravo/wp-custom-bulk-actions - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. seravo/wp-custom-bulk-actions

ActiveWordpress-plugin[Utility &amp; Helpers](/categories/utility)

seravo/wp-custom-bulk-actions
=============================

Custom bulk actions for any type of posts in WordPress.

0.1.4(8y ago)6612.1k↓16.7%8[3 issues](https://github.com/Seravo/wp-custom-bulk-actions/issues)GPLv3PHP

Since Jun 17Pushed 5y ago4 watchersCompare

[ Source](https://github.com/Seravo/wp-custom-bulk-actions)[ Packagist](https://packagist.org/packages/seravo/wp-custom-bulk-actions)[ Docs](https://github.com/Seravo/wp-custom-bulk-actions)[ RSS](/packages/seravo-wp-custom-bulk-actions/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (4)Used By (0)

Custom Bulk Actions
===================

[](#custom-bulk-actions)

[![Build Status](https://camo.githubusercontent.com/fc655fbea039043c3bb5679e7600c97296713be85335e4e8ca565eb114cc1d61/68747470733a2f2f7472617669732d63692e6f72672f53657261766f2f77702d637573746f6d2d62756c6b2d616374696f6e732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Seravo/wp-custom-bulk-actions)Custom bulk actions for any type of posts in WordPress.

Currently Wordpress doesn't allow you to add custom bulk actions. See [codex](http://codex.wordpress.org/Plugin_API/Filter_Reference/bulk_actions). Adding them is super easy with this plugin.

This is based on solution found [here](http://www.skyverge.com/blog/add-custom-bulk-action/), but makes it more easier to use.

Installation
------------

[](#installation)

Available for installation via [Composer via Packagist](https://packagist.org/packages/seravo/wp-custom-bulk-actions) or [GitHub Plugin Search](https://github.com/brainstormmedia/github-plugin-search).

Plugin
------

[](#plugin)

This plugin adds a class named Seravo\_Custom\_Bulk\_Action

### Class functions

[](#class-functions)

Constructor with post as default post type

```
new Seravo_Custom_Bulk_Action(array('post_type' => $custom_post));
```

Add actions. You must define at least menu\_text and callback function.

```
register_bulk_action(array(
'menu_text' => $your_menu_text,
'admin_notice' => $display_text_for_admin,
'action_name' => $optional_action_name,
'callback' => $anonymous_function
));
```

admin\_notice parameter accepts arrays for plural texts too (thanks @cyberwani) For example:

```
register_bulk_action(array(
'menu_text' => $your_menu_text,
'admin_notice' => 'admin_notice'=>array(
    'single' => '%s Appointment cancelled.',
    'plural' => '%s Appointments cancelled.',
),
'action_name' => $optional_action_name,
'callback' => $anonymous_function
));
```

Your anonymous callback function needs to have post\_ids as parameter:

```
function($post_ids) {
	//Do something here
};
$post_ids //Array of post IDs selected by user in admin panel
```

Init functions to wordpress

```
init();
```

Example &amp; how to use
------------------------

[](#example--how-to-use)

Install plugin and define your bulk actions in `functions.php`.

In this example we're going to update metadata \_property\_status of custom posts called property

```
//Define bulk actions for custom-post-type property
$bulk_actions = new Seravo_Custom_Bulk_Action(array('post_type' => 'property'));

//ACTION EXAMPLE 1:

$bulk_actions->register_bulk_action(array(
	'menu_text'=>'Mark as sold (Myyty)',
	'admin_notice'=>'Properties marked as sold',
	'callback' => function($post_ids) {

	//Do something with $post_ids here

	//In this example properties are marked as sold
	foreach ($post_ids as $post_id) {
		update_post_meta($post_id,"_property_status", "sold");
	}
	return true;
}));

//ACTION EXAMPLE 2, non-ascii chars in menutext:
//Defining the action_name is optional but useful if you want to have non-ascii chars in menu_text

$bulk_actions->register_bulk_action(array(
	'menu_text'=>'Mark for sale (Myytäväksi)',
	'admin_notice'=>'Properties marked for sale',
	'action_name'=>'for_sale',
	'callback' => function($post_ids) {

	//Do something with $post_ids here

	//In this example properties are marked for sale
	foreach ($post_ids as $post_id) {
		update_post_meta($post_id,"_property_status", "sale");
	}
	return true;
}));

//Finally init actions
$bulk_actions->init();
```

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity38

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 69.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~509 days

Total

3

Last Release

2969d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c8f6762f3f88e0fd935c325980505195229a4f2fc7e4aa6fb1858d00a8117423?d=identicon)[Seravo](/maintainers/Seravo)

---

Top Contributors

[![onnimonni](https://avatars.githubusercontent.com/u/5691777?v=4)](https://github.com/onnimonni "onnimonni (27 commits)")[![ottok](https://avatars.githubusercontent.com/u/668724?v=4)](https://github.com/ottok "ottok (5 commits)")[![sjaks](https://avatars.githubusercontent.com/u/44066308?v=4)](https://github.com/sjaks "sjaks (4 commits)")[![cyberwani](https://avatars.githubusercontent.com/u/1647283?v=4)](https://github.com/cyberwani "cyberwani (2 commits)")[![antongorodezkiy](https://avatars.githubusercontent.com/u/580599?v=4)](https://github.com/antongorodezkiy "antongorodezkiy (1 commits)")

---

Tags

wordpresspostscustombulk action

### Embed Badge

![Health badge](/badges/seravo-wp-custom-bulk-actions/health.svg)

```
[![Health](https://phpackages.com/badges/seravo-wp-custom-bulk-actions/health.svg)](https://phpackages.com/packages/seravo-wp-custom-bulk-actions)
```

###  Alternatives

[vinkla/extended-acf

Register advanced custom fields with object-oriented PHP

503264.8k11](/packages/vinkla-extended-acf)[php-stubs/wordpress-stubs

WordPress function and class declaration stubs for static analysis.

19513.0M263](/packages/php-stubs-wordpress-stubs)[wpsitecare/carelib

A collection of helpful functions to make creating an awesome theme more enjoyable.

164.6k](/packages/wpsitecare-carelib)[bostondv/bootstrap-ninja-forms

Adds Bootstrap classes to Ninja Forms

222.2k](/packages/bostondv-bootstrap-ninja-forms)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
