Below is a code sample of my contextual filter validation code for drupal 7 views 3 validation.
My view contains a page display with the following path set: blog/%/%/%
Here is a sample path argument of what I'm trying to accomplish:
Path URL: blog/7/node-title/taxonomy-name
if ( is_numeric(arg(1)) && is_string(arg(3)) ) {
//check to make sure arg 1 is text and arg 2 is a string
$node = node_load(arg(1));
//load the node
$terms = taxonomy_get_term_by_name(arg(3));
//get the terms array and TID from arg 3.
if (!empty($terms)) {
$first_term = array_shift($terms);
foreach($node->field_repair_states_region['und'] as $x => $y) {
if( $y['tid'] == $first_term->tid ) { return TRUE; }
//make sure the TID matches the TID to the node.
}
}
}
Screenshot of Validation Page: http://prntscr.com/1dcl4v
Screenshot of View: http://prntscr.com/1dclly