Support » Plugin: Squelch Tabs and Accordions Shortcodes » Invalid argument supplied for foreach()

  • Resolved 4k


    just installed the Squelch Tabs and Accordions Shortcodes plugin and the tabs show but with this error above them.

    I did the deactivate all other plugins and that didn’t work.

    Ideas on what else I can do?

    Warning: Invalid argument supplied for foreach() in /home/xxx/public_html/xxxxxx/wp-content/plugins/squelch-tabs-and-accordions-shortcodes/squelch-tabs-and-accordions.php on line 423

    Warning: Invalid argument supplied for foreach() in /home/mxxx/public_html/xxxxxx/wp-content/plugins/squelch-tabs-and-accordions-shortcodes/squelch-tabs-and-accordions.php on line 427

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Matt Lowe


    Hi 4k, could you post the code you’re using in the editor for me?

    I just copied from the example here and changed the titles

    [tabs title=”” disabled=”false” collapsible=”true” active=”0″ event=”click”]
    [tab title=”Welcome”]Tab 0 content[/tab]
    [tab title=”stuff about book”]Tab 1 content[/tab]
    [tab title=”Reviews”]Tab 2 content[/tab]


    Plugin Author Matt Lowe


    Aha, seems there’s a bug which is ignored normally but displayed when WP_DEBUG is enabled, so I’m guessing you have WP_DEBUG enabled? I’ll take a look into the issue.

    according to the config file it is not enabled define(‘WP_DEBUG’, false);

    Plugin Author Matt Lowe


    No you’re right, your code still causes an error even without WP_DEBUG enabled. I’m digging into it at the moment, there’s something fishy going on with the tab group counter, it currently counts 0, 2, 3, 4… it’s the lack of a 1 that’s causing problems. I’m trying to work out why it’s skipping 1.

    Plugin Author Matt Lowe


    Heh, the bug is in your code. I just couldn’t see for looking. You’ve got a [tabs ...] inside of a [tabs ...]. Here’s how your code should read:

    [tabs title="" disabled="false" collapsible="true" active="0" event="click"]
    [tab title="Welcome"]Tab 0 content[/tab]
    [tab title="stuff about book"]Tab 1 content[/tab]
    [tab title="Reviews"]Tab 2 content[/tab]

    do’h. Thanks very much! I’ll leave a tip in your jar 🙂

    I’m having the same issue but it doesn’t seem to have the same cause. I’m using a theme called “Mission” and the tabs that came with it didn’t work, so I tried to use your plugin and I get the same error message as listed above.

    My code:

    [tabs title="test1" disabled="false" collapsible="true" active="0" event="click"] [tab title="Tab 0"]Tab 0 content[/tab] [tab title="Tab 1"]Tab 1 content[/tab] [tab title="Tab 2"]Tab 2 content[/tab][/tabs]

    Plugin Author Matt Lowe


    You have a completely different issue. Your theme is almost certainly incompatible with Squelch Tabs and Accordions Shortcodes. Not much I can do about that I’m afraid.

    Cool, thanks anyway!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Invalid argument supplied for foreach()’ is closed to new replies.