Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- add_action('plugins_loaded', 'condition_url_param_exist_elijah', 99);
- function condition_url_param_exist_elijah(){
- if( function_exists('oxygen_vsb_register_condition') ) {
- global $oxy_condition_operators;
- // Condition to check if a URL parameter is present.
- oxygen_vsb_register_condition('URL Param Exists', array('options'=>array(), 'custom'=>true), array('--'), 'oxy_url_param_exists_callback', 'Other');
- function oxy_url_param_exists_callback($value, $operator) {
- if( isset($_GET[$value]) && $_GET[$value] ) {
- return true;
- } else {
- return false;
- }
- }
- // Condition to check if a URL parameter is NOT present.
- oxygen_vsb_register_condition('URL Param Does Not Exist', array('options'=>array(), 'custom'=>true), array('--'), 'oxy_url_param_not_exists_callback', 'Other');
- function oxy_url_param_not_exists_callback($value, $operator) {
- if( isset($_GET[$value]) && $_GET[$value] ) {
- return false;
- } else {
- return true;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement