public function post(\WC_Product $WC_Product)
    {
        if (!$WC_Product->exists()) {
            return null; // Not possible.
        }
        if ($WC_Product->is_type('variation')) {
            $WP_Post = get_post($WC_Product->get_parent_id());
        } else {
            $WP_Post = get_post($WC_Product->get_id());
        }
        return $WP_Post instanceof \WP_Post && $WP_Post->ID ? $WP_Post : null;
    }
public function post(\WC_Product $WC_Product)
    {
        if (!$WC_Product->exists()) {
            return null; // Not possible.
        }
        if ($WC_Product->is_type('variation')) {
            $WP_Post = get_post($WC_Product->get_parent_id());
        } else {
            $WP_Post = get_post($WC_Product->get_id());
        }
        return $WP_Post instanceof \WP_Post && $WP_Post->ID ? $WP_Post : null;
    }
public function post ( \ WC_Product $ WC_Product ) { if ( ! $ WC_Product -> exists ( ) ) { return null ; // Not possible. } if ( $ WC_Product -> is_type ( 'variation' ) ) { $ WP_Post = get_post ( $ WC_Product -> get_parent_id ( ) ) ; } else { $ WP_Post = get_post ( $ WC_Product -> get_id ( ) ) ; } return $ WP_Post instanceof \ WP_Post && $ WP_Post -> ID ? $ WP_Post : null ; }
Product post.

@since 170420.14768 WC product utils.

@param \WC_Product $WC_Product Product.

@return \WP_Post|null Post, else `null`.
Product post .