1

I want to know is there any hook to remove the Restore link in the edit page - trash page?

/wp-admin/edit.php?post_status=trash

I know I can hide it with a css/jquery trick, but I prefer to use a hook for this.

enter image description here

2
  • Are you referring to this: cl.ly/HewQ ? In any case, please add more details to your question...
    – brasofilo
    Commented Jun 26, 2012 at 14:44
  • Yes, this is what I meant
    – dev-jim
    Commented Jun 26, 2012 at 16:01

1 Answer 1

3

This will do:

add_filter('post_row_actions', 'wpse_56560_remove_untrash', 10, 2);
add_filter('page_row_actions', 'wpse_56560_remove_untrash', 10, 2);

function wpse_56560_remove_untrash( $actions, $post ) 
{
    if( !isset( $actions['untrash'] ) ) 
        return $actions;

    // If NOT administrator, remove Untrash
    if( !current_user_can('administrator') )
        unset( $actions['untrash'] );

    return $actions; 
}
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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