How to change the title of a Drupal 7 Views 3 via code

/**
 * Implements hook_views_post_render().
 */
function MODULENAME_views_post_render($view) {
  if ($view->name == 'my_view_name') {
    if ($view->current_display == 'my_display_name') {
      $view->set_title(check_plain($new_title)));
    }
  }
}
Links: hook_views_post_render(), view::set_title