WordPress at Your Fingertips
function is not described

WC_Product_CSV_Exporter::get_column_value_parent_id() protected WC 3.1.0

Get parent_id value.

{} It's a method of the class: WC_Product_CSV_Exporter{}

No Hooks.

Return

String.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_column_value_parent_id( $product );
$product(WC_Product) (required)
Product being exported.

Changelog

Since 3.1.0 Introduced.

Code of WC_Product_CSV_Exporter::get_column_value_parent_id() WC 5.9.0

protected function get_column_value_parent_id( $product ) {
	if ( $product->get_parent_id( 'edit' ) ) {
		$parent = wc_get_product( $product->get_parent_id( 'edit' ) );
		if ( ! $parent ) {
			return '';
		}

		return $parent->get_sku( 'edit' ) ? $parent->get_sku( 'edit' ) : 'id:' . $parent->get_id();
	}
	return '';
}