• Resolved polarracing

    (@polarracing)


    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)
  • What happens when you add and between these conditions?
    Peter

    Thread Starter polarracing

    (@polarracing)

    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 5 years, 5 months ago by polarracing.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘PHP Errors with IF-CLAUSE’ is closed to new replies.