[resolved] WARNING: Creating default object from empty value... Thanks Woothemes, again! (4 posts)

  1. Pocket Flan
    Posted 2 years ago #

    It's really unbelievable the amount of Woocommerce updates that keep breaking stuff or show new warnings, themes break, codes break here and there, plugins break... it never ends. These guys must be so desperate, it's really embarrassing.

    The following code used to work fine:

    add_action('init', 'PF_renameCategoryTags');
    function PF_renameCategoryTags() {
        global $wp_taxonomies;
        $cat = $wp_taxonomies['product_cat'];
        $cat->label = 'My Categories'; // breaks in WC 2.1.10
        $cat->labels->singular_name = 'My Category'; // breaks in WC 2.1.10
        $cat->labels->name = $cat->label;
        $cat->labels->menu_name = $cat->label;

    After updating Woocommerce to 2.1.10 I received the following warning pointing to the above code:

    Warning: Creating default object from empty value in /home/.../functions.php on line x, y, z


  2. tweakben
    Posted 2 years ago #

    This is why you test the updates on a non-live server. People never learn.

  3. Mike Jolley
    Plugin Author

    Posted 2 years ago #

    I've responded here http://wordpress.org/support/topic/warning-creating-default-object-from-empty-value-thanks-woothemes-again-1?replies=2#post-5666434

    In general, hacking WordPress globals is asking for trouble anyway.

  4. Pocket Flan
    Posted 2 years ago #

    @tweakben, "non-live" servers... you sound like an amateur dude.
    LIVE TEST servers is what I play with. Learn some and never assume again.


    @mikejolley, see my reply: http://wordpress.org/support/topic/warning-creating-default-object-from-empty-value-thanks-woothemes-again-1?replies=2#post-5666434

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic