WordPress at Your Fingertips
function is not described

WC_Embed::the_excerpt() public WC 2.4.11

Create the excerpt for embedded products - we want to add the buy button to it.

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

No Hooks.

Return

String.

Usage

$result = WC_Embed::the_excerpt( $excerpt );
$excerpt(string) (required)
Embed short description.

Changelog

Since 2.4.11 Introduced.

Code of WC_Embed::the_excerpt() WC 5.6.0

public static function the_excerpt( $excerpt ) {
	global $post;

	// Get product.
	$_product = wc_get_product( get_the_ID() );

	// Make sure we're only affecting embedded products.
	if ( self::is_embedded_product() ) {
		echo '<p><span class="wc-embed-price">' . $_product->get_price_html() . '</span></p>'; // WPCS: XSS ok.

		if ( ! empty( $post->post_excerpt ) ) {
			ob_start();
			woocommerce_template_single_excerpt();
			$excerpt = ob_get_clean();
		}

		// Add the button.
		$excerpt .= self::product_buttons();
	}
	return $excerpt;
}