Embedding Views programmatically getting argument overridden title I'm embedding a View inside my custom module, using views_embed_view

From the docs for this function:


  Note that this function does NOT display the title of the view. If you
  want to do that, you will need to do what this function does manually,
  by loading the view, getting the preview and then getting
  $view->get_title().


However, my View has no title, instead I've set my contextual filter to override the title (from the arguments in the url).
How do I get this title? 

Thanks

Edit: Here is a screengrab of my contextual filter settings.  I'm actually currently using the default taxonomy_term view that comes with Views out of the box.
Okay I got it...

After executing the view in your code (e.g. with a $view->preview()).
You need to find the argument in the view that sets the title, and then call set_title() on it.

Here's what I did (note that I'm assuming that in the case of multiple arguments setting titles it's the last one that works, hence the array_reverse, haven't tested this yet).

&lt;?php
$view = views_get_view('taxonomy_term');
$view-&gt;preview('panel_pane_1', array($tid));
foreach (array_reverse($view-&gt;argument) as $argument) {
    if ($argument-&gt;options['title_enable']) {
        $page_title = $argument-&gt;get_title();
        break;
    }
}
?&gt;


Hope that helps someone else out.