rveitch
8/3/2015 - 5:17 PM

Remove "Trash" option from non-admin users in WordPress

Remove "Trash" option from non-admin users in WordPress

/**
 * Remove "Trash" option from non-admin users
 * Added: 08/03/15 rveitch
 */
if ( ! is_admin() ) {
  add_filter( 'post_row_actions', 'remove_row_actions', 10, 1 );
  function remove_row_actions( $actions )
  {
      if( get_post_type() === 'post' )
          unset( $actions['trash'] );
      return $actions;
  }
}