Browse files

Allow redirects to be bulk deleted from the Manage Redirects view

Closes #23
  • Loading branch information...
1 parent 17e7701 commit 6ac98b8f47de29b100239ef8f19c9f3884dc6e56 @danielbachhuber danielbachhuber committed Dec 9, 2012
Showing with 11 additions and 7 deletions.
  1. +3 −0 readme.txt
  2. +8 −7 safe-redirect-manager.php
View
3 readme.txt
@@ -24,6 +24,9 @@ Extract the zip file and just drop the contents in the wp-content/plugins/ direc
== Changelog ==
+= 1.6 (??? ??, 2012) =
+* Bulk delete redirects from the Manage Redirects screen
+
= 1.5 (Nov. 7 2012) =
* Regular expressions allowed in redirects
* New filter 'srm_registered_redirects' allows you to conditionally unset redirects based on context, user permissions, etc. Thanks [jtsternberg](https://github.com/jtsternberg) for the pull request.
View
15 safe-redirect-manager.php
@@ -66,7 +66,7 @@ public function __construct() {
add_filter( 'post_updated_messages', array( $this, 'filter_redirect_updated_messages' ) );
add_action( 'admin_notices', array( $this, 'action_redirect_chain_alert' ) );
add_filter( 'the_title', array( $this, 'filter_admin_title' ), 100, 2 );
- add_filter( 'bulk_actions-' . 'edit-redirect_rule', array( $this, 'filter_bulk_actions' ) );
+ add_filter( 'bulk_actions-edit-' . $this->redirect_post_type, array( $this, 'filter_bulk_actions' ) );
add_action( 'admin_print_styles-edit.php', array( $this, 'action_print_logo_css' ), 10, 1 );
add_action( 'admin_print_styles-post.php', array( $this, 'action_print_logo_css' ), 10, 1 );
add_action( 'admin_print_styles-post-new.php', array( $this, 'action_print_logo_css' ), 10, 1 );
@@ -191,13 +191,17 @@ public function action_print_logo_css() {
}
/**
- * Removes bulk actions from post manager
+ * Limit the bulk actions available in the Manage Redirects view
*
* @since 1.0
* @return array
*/
- public function filter_bulk_actions() {
- return array();
+ public function filter_bulk_actions( $actions ) {
+
+ // No bulk editing at this time
+ unset( $actions['edit'] );
+
+ return $actions;
}
/**
@@ -461,9 +465,6 @@ public function filter_redirect_columns( $columns ) {
unset( $columns['date'] );
$columns['date'] = __( 'Date', 'safe-redirect-manager' );
- // get rid of checkboxes
- unset( $columns['cb'] );
-
return $columns;
}

0 comments on commit 6ac98b8

Please sign in to comment.