• Resolved javierlinares

    (@javierlinares)


    Notice: WC_Product::get_parent is deprecated1 since version 3.0! Use WC_Product::get_parent_id instead. in /home/vinda/www/pruebas/wp-includes/functions.php on line 4648

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter javierlinares

    (@javierlinares)

    This error appears continuously in the logs.

    Plugin Support AW a11n

    (@slash1andy)

    Automattic Happiness Engineer

    Hey there!

    That error means your site is running either a plugin or a theme that is outdated and needs updating. Normally that error message will have a bit more info there to tell you where it’s coming from, but at the least, make sure that you update all your themes and plugins on your site to the latest versions.

    Hopefully that helps! Have a great one!

    Thread Starter javierlinares

    (@javierlinares)

    Hi,
    Wordpress versión 5.3.2
    Woocommerce Versión 3.9.3

    If I do a search of the string “WC_Product :: get parent” in all the files, I get the following results:

    www\pruebas\wp-content\pluggins\woocommerce\includes\legacy\abstract-wc-legacy-product.php (Line 417)

    This line is te code:

    /**
    * Get the parent of the post.
    *
    * @deprecated 3.0.0
    * @return int
    */
    public function get_parent() {
    wc_deprecated_function( ‘WC_Product::get_parent’, ‘3.0’, ‘WC_Product::get_parent_id’ );
    return apply_filters( ‘woocommerce_product_parent’, absint( $this->get_post_data()->post_parent ), $this );

    Plugin Support AW a11n

    (@slash1andy)

    Automattic Happiness Engineer

    As mentioned, there is a theme or a plugin on your site that is calling an old WooCommerce function. You are seeing it in the WooCommerce plugin because we keep old versions of functions around to show the notice you are seeing, that it’s deprecated and you need to update the code on your site.

    If you need to locate it, search for get_parent and not WC_Product::get_parent

    In general, :: is used for scope resolution, and it may have either a class name, parent, self, or (in PHP 5.3) static to its left.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘WC_Product::get_parent is deprecated1 since version 3.0’ is closed to new replies.