Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I would like to modify the wording in the bulk actions on the posts screen or custom post types. I am trying to do so using the following code, but it's not working. Any idea why?

add_filter( 'bulk_actions-edit-post', 'my_custom_bulk_actions' );
function my_custom_bulk_actions( $actions ){
    $actions['trash'] = 'Just testing';

    unset( $actions[ 'edit' ] );
    return $actions;
}
share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

There's currently no possibility to modify those. Just renaming it (the label in the UI only) via JS is possible.

I'd recommend to not try to modify those strings, as they equal action names and therefore are part of the query strings. You might break things easily. Figuring out what causes things to brake a half year later will just be a pain.

share|improve this answer
    
Would it be ok to add items as done in foxrunsoftware.net/articles/wordpress/add-custom-bulk-action? –  drtanz Sep 19 '12 at 15:17
    
I wouldn't do that. Just leave the original names. As I said: Those are the names of actions. If you try that, then A) with js B) at your own risk and C) it's a lot of effort (names are spread over the whole UI like messages, etc.) that will likely break on updates. –  kaiser Sep 19 '12 at 15:23
add comment

As far I know, That hook can only be used to remove particular action.

// This filter can currently only be used to remove actions.                              
$this->_actions = apply_filters( 'bulk_actions-' . $this->screen->id, $this->_actions );

Source - class-wp-list-table.php (Line - 282)

share|improve this answer
    
Here's the track ticket - core.trac.wordpress.org/ticket/16031 –  amit Sep 19 '12 at 13:18
    
I was hoping someone has come up with a solution to modify the wording, since there is also a solution to add items foxrunsoftware.net/articles/wordpress/add-custom-bulk-action –  drtanz Sep 19 '12 at 13:32
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.