WordPress at Your Fingertips
function is not described

WC_Post_Data::variation_post_link() public WC 1.0

Link to parent products when getting permalink for variation.

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

No Hooks.

Return

String.

Usage

$result = WC_Post_Data::variation_post_link( $permalink, $post );
$permalink(string) (required)
Permalink.
$post(WP_Post) (required)
Post data.

Code of WC_Post_Data::variation_post_link() WC 5.6.0

public static function variation_post_link( $permalink, $post ) {
	if ( isset( $post->ID, $post->post_type ) && 'product_variation' === $post->post_type ) {
		$variation = wc_get_product( $post->ID );

		if ( $variation && $variation->get_parent_id() ) {
			return $variation->get_permalink();
		}
	}
	return $permalink;
}