argument)) { // Grab the argument handlers $h = $view->argument; // Splice the arguments and get the key for the current arg. $hh = array_splice($h, count($args)-1, 1); $h = array_shift($hh); // Get the Page Title Pattern from the options array for this handler $pattern = isset($h->options['page_title_pattern']) ? $h->options['page_title_pattern'] : $pattern; // If a page title pattern was found AND it contains a "%", assume there are placeholders and apply the %1, %2 type placeholder replacement. if (strpos($pattern, '%') !== FALSE) { // Grab the pre-built substitutions $subs = $view->build_info['substitutions']; // Apply any subs to the pattern $pattern = str_replace(array_keys($subs), $subs, $pattern); } } // This is a view with no args provided, or the specific arg has no title - lets use the base display title elseif (isset($view->display_handler) && $view->display_handler->display->display_plugin == 'page_with_page_title') { $pattern = $view->display_handler->get_option('page_title_pattern'); } } }