Skip to content

Instantly share code, notes, and snippets.

@Spellhammer
Created April 28, 2020 15:01
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Spellhammer/042129f07ea68c8c118d0618945230cd to your computer and use it in GitHub Desktop.
Save Spellhammer/042129f07ea68c8c118d0618945230cd to your computer and use it in GitHub Desktop.
"Access" URL Param Condition for Oxygen
if( function_exists('oxygen_vsb_register_condition') ) {
global $oxy_condition_operators;
// Condition to check if a URL parameter is present.
oxygen_vsb_register_condition('Access Code', array('options'=>array(), 'custom'=>true), $oxy_condition_operators['string'], 'oxy_access_code_callback', 'Other');
function oxy_access_code_callback($value, $operator) {
if( $operator == '==') {
if( !empty( $_GET['access'] ) && $_GET['access'] == $value ) {
return true;
} else {
return false;
}
} else if( $operator == '!=' ) {
if( empty( $_GET['access'] ) || $_GET['access'] != $value ) {
return true;
} else {
return false;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment