Created
December 8, 2022 18:42
-
-
Save Spellhammer/e45fba76d65234534d1261cc1e434b16 to your computer and use it in GitHub Desktop.
Has Password Oxygen Condition
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if( function_exists('oxygen_vsb_register_condition') ) { | |
global $oxy_condition_operators; | |
oxygen_vsb_register_condition('Has Password', array('options'=>array('true', 'false'), 'custom'=>false), array('=='), 'has_password_callback', 'Post'); | |
function has_password_callback($value, $operator) { | |
if( $value == "true" && post_password_required( get_the_ID() ) ) { | |
return true; | |
} else if( $value == "false" && !post_password_required( get_the_ID() ) ) { | |
return true; | |
} else { | |
return false; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment