Title: PHP Errors with IF-CLAUSE
Last modified: September 19, 2019

---

# PHP Errors with IF-CLAUSE

 *  Resolved [polarracing](https://wordpress.org/support/users/polarracing/)
 * (@polarracing)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/php-errors-with-if-clause/)
 * I experienced an issue with the IF clause.
 * This
 * `[if field=event-optional value='hotel' field_2=event-inclusive value_2='hotel']`
 * will throw this error message:
 *     ```
       Warning: array_map(): Expected parameter 2 to be an array, null given in C:\xampp\htdocs\wordpress\wp-content\plugins\custom-content-shortcode\includes\modules\if.php on line 1534
   
       Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\wordpress\wp-content\plugins\custom-content-shortcode\includes\modules\if.php on line 605
       ```
   
 * while splitting the if-clause into two works fine and throws no errors:
 *     ```
       [if field=event-optional value='hotel']
       	[set show_sleep]yes[/set]
       [/if]
       [if field=event-inclusive value='hotel']
       	[set show_sleep]yes[/set]
       [/if]
   
       [if var=show_sleep value='yes']
       ```
   
 * Am I’m blind not seeing my own error or is this an issue others had as well?

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Peter Berger](https://wordpress.org/support/users/peterpolow/)
 * (@peterpolow)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/php-errors-with-if-clause/#post-11947639)
 * What happens when you add `and` between these conditions?
    Peter
 *  Thread Starter [polarracing](https://wordpress.org/support/users/polarracing/)
 * (@polarracing)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/php-errors-with-if-clause/#post-11947697)
 * THANKS Peter!!
 * Thats what I meant with being blind.
 * As I needed the ‘or’ I did not even think about that. But simply adding an ‘or’
   between the two fields solved the issue.
    -  This reply was modified 6 years, 8 months ago by [polarracing](https://wordpress.org/support/users/polarracing/).

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘PHP Errors with IF-CLAUSE’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/custom-content-shortcode_766976.svg)
 * [Custom Content Shortcode](https://wordpress.org/plugins/custom-content-shortcode/)
 * [Support Threads](https://wordpress.org/support/plugin/custom-content-shortcode/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-content-shortcode/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-content-shortcode/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-content-shortcode/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [polarracing](https://wordpress.org/support/users/polarracing/)
 * Last activity: [6 years, 8 months ago](https://wordpress.org/support/topic/php-errors-with-if-clause/#post-11947697)
 * Status: resolved