Skip to content

Instantly share code, notes, and snippets.

@bolstad
Created December 7, 2012 16:02
Show Gist options
  • Save bolstad/4234224 to your computer and use it in GitHub Desktop.
Save bolstad/4234224 to your computer and use it in GitHub Desktop.
extend wpv-if shortcode
add_filter('wpv-extra-condition-filters', 'wpv_add_time_functions');
function wpv_add_time_functions($value)
{
// is_get_param($_GET['parameter']) - returns true if parameter is set
if (preg_match('/is_get_param\((.*)\)/',$value,$matches))
{
$uriparameter = $matches[1];
if (isset ($_GET[$uriparameter]))
return '1=1';
}
return $value;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment