WordPress.org

Ready to get started?Download WordPress

Forums

Squelch Tabs and Accordions Shortcodes
[resolved] Invalid argument supplied for foreach() (11 posts)

  1. 4k
    Member
    Posted 9 months ago #

    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

    http://wordpress.org/plugins/squelch-tabs-and-accordions-shortcodes/

  2. Matt Lowe
    Member
    Plugin Author

    Posted 9 months ago #

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

  3. 4k
    Member
    Posted 9 months ago #

    I just copied from the example here and changed the titles
    http://squelchdesign.com/wordpress-plugin-squelch-tabs-accordions-shortcodes/

    [tabs]
    [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]

    [/tabs]

  4. Matt Lowe
    Member
    Plugin Author

    Posted 9 months ago #

    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.

  5. 4k
    Member
    Posted 9 months ago #

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

  6. Matt Lowe
    Member
    Plugin Author

    Posted 9 months ago #

    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.

  7. Matt Lowe
    Member
    Plugin Author

    Posted 9 months ago #

    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]
    [/tabs]
  8. 4k
    Member
    Posted 9 months ago #

    do'h. Thanks very much! I'll leave a tip in your jar :)

  9. Rylandish
    Member
    Posted 2 months ago #

    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]

  10. Matt Lowe
    Member
    Plugin Author

    Posted 2 months ago #

    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.

  11. Rylandish
    Member
    Posted 2 months ago #

    Cool, thanks anyway!

Reply

You must log in to post.

About this Plugin

About this Topic

Tags