• Resolved majecdad

    (@majecdad)


    Recent update to 1.0. I get the following when the second box in settings: CPT and taxs, is checked as active.

    Warning: Invalid argument supplied for foreach() in myURL/wp-content/plugins/widget-context/modules/custom-post-types-taxonomies/custom-cpt-tax.php on line 88

    Warning: Invalid argument supplied for foreach() in myURL/wp-content/plugins/widget-context/modules/custom-post-types-taxonomies/custom-cpt-tax.php on line 98

    If I uncheck it, the warning goes away.

    https://wordpress.org/plugins/widget-context/

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Kaspars

    (@kasparsd)

    Thanks for reporting this, @majecdad! I’ll have a look.

    I am having the same problem. Any widget I use in my side bar now gives me this warning: Warning: Invalid argument supplied for foreach() in /home2/bluemoon/public_html/wp-content/plugins/widget-context/modules/custom-post-types-taxonomies/custom-cpt-tax.php on line 88
    If I remove the widget the error message is gone, but I’d really like to use my side bar again.
    Linda

    Hello Kaspars,

    Putting
    if (!empty($this->post_types)) {

    and

    if (!empty($this->taxonomies)) {

    removes the errors, but I am not sure this is the right approach.

    Regards,
    Spyros

    Plugin Author Kaspars

    (@kasparsd)

    Thanks for reporting this issue! It has been fixed in version 1.0.1.

    Just as a doublecheck, this same error was outputting when I installed Woocommerce. I don’t have time to check for you, but it might be worthwhile just to doublecheck that the error doesn’t appear when installing Woocommerce (straight out of the box, no configuration). Thanks for the great update!

    Thread Starter majecdad

    (@majecdad)

    Excellent. Confirming it works properly for me with 1.0.1 (and on a site that has WooC 2.1 active also, so no problem there for me).

    Thanks.

    I am sorry to say that with Woocommerce installed and random products widget active the error is still there.
    Thanks for the effort tho.

    Regards,
    Spyros

    Plugin Author Kaspars

    (@kasparsd)

    @spyrosvl are you running Widget Context 1.0.1?

    James Maiden

    (@reallygreenjames)

    Kaspars – thanks for responding on this thread and huge thanks for your plugin. I use it on loads of websites – it’s an essential tool for me.

    I too am sorry to report that I have installed Widget Context 1.0.1 and Woocommerce 2.1.12 installed, as well as a few other plugins.

    The same error is returned:

    Warning: Invalid argument supplied for foreach() in /home/retromet/public_html/wp-content/plugins/widget-context/modules/custom-post-types-taxonomies/custom-cpt-tax.php on line 88

    I actually have no CPT and Taxonmies selected in the Widget Context widget.

    Plugin Author Kaspars

    (@kasparsd)

    I have looked into the WooCommerce plugin source code and it looks like it is checking for widget existence before the main WordPress post query has run. This causes all widget visibility checks to report false visibility conditions.

    I have updated the Widget Context plugin to make sure it runs only after the main post query has run. The update should go out in a few hours.

    Plugin Author Kaspars

    (@kasparsd)

    The plugin has been updated to 1.0.2, which should fix the issue with WooCommerce.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Warning: Invalid argument’ is closed to new replies.