Hide content unless ?access= in URL equals defined value (Conditions)
Fri May 20 2022 11:19:34 GMT+0000 (Coordinated Universal Time)
Saved by
@MirkoEchghiG
<?php
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;
}
}
}
}
content_copyCOPY
Comments