Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- global $resident_input;
- function getResidentInput(){
- $resident_input = '';
- if(isset($_POST['resident']))
- {
- $resident_input = $_POST['resident'];
- echo "<br>Resident input1: $resident_input<br>";
- }
- return $resident_input;
- }
- echo "<br>Resident input2: $resident_input<br>";
- if ( function_exists( 'oxygen_vsb_register_condition' ) ) {
- oxygen_vsb_register_condition(
- // Condition Name
- 'Is WA Resident',
- // Values: The array of pre-set values the user can choose from.
- // Set the custom key's value to true to allow users to input custom values.
- array(
- 'options' => array( 'Yes', 'No' ),
- 'custom' => false,
- ),
- // Operators
- array( '==' ),
- // Callback Function: Name of function that will be used to handle the condition
- 'wpdd_is_waresident_callback',
- // Condition Category: Default ones are Archive, Author, Other, Post, User
- 'Other'
- );
- }
- /**
- * Callback function to handle the condition.
- * @param mixed $value Input value - in this case, true or false selected by the user.
- * @param string $operator Comparison operator selected by the user.
- *
- * @return boolean true or false.
- */
- function wpdd_is_waresident_callback( $value, $operator ) {
- echo "Value: $value";
- echo "<br>Resident input3: " . getResidentInput() . "<br>";
- if ( getResidentInput() === $value ) {
- return true;
- } else {
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement