The var_dump()
before using shortcode_atts()
reveals the problem. Lets look at that output in a more readable format:
array(5) {
[0] => string(42) "phonePrefix="0581",phoneFlatOption="true","
[1]=> string(21) "accessModeDsl="true","
[2]=> string(24) "accessModeCable="false","
[3]=> string(22) "accessModeLte="false","
["accessmodesat"]=> string(5) "false"
}
As you can see, the attributes are not being parsed correctly. Instead of 'attribute' => 'value'
you’re getting a numerically indexed array of broken bits of the shortcode.
This is because of the way you’ve written the shortcode, not anything in the shortcode code itself.
[comparison phonePrefix="0581",phoneFlatOption="true",
accessModeDsl="true", accessModeCable="false", accessModeLte="false",
accessModeSat="false"]
The lack of spaces between the attributes and the use of commas is incorrect formatting for shortcodes. It should be formatted like this:
[comparison phonePrefix="0581" phoneFlatOption="true"
accessModeDsl="true" accessModeCable="false" accessModeLte="false"
accessModeSat="false"]