woocommerce_default_product_tabs()WC 1.0

Add default product tabs to product pages.

Хуки из функции

Возвращает

Массив.

Использование

woocommerce_default_product_tabs( $tabs );
$tabs(массив)
Array of tabs.
По умолчанию: array()

Код woocommerce_default_product_tabs() WC 9.8.2

function woocommerce_default_product_tabs( $tabs = array() ) {
	global $product, $post;

	// Description tab - shows product content.
	if ( $post->post_content ) {
		$tabs['description'] = array(
			'title'    => __( 'Description', 'woocommerce' ),
			'priority' => 10,
			'callback' => 'woocommerce_product_description_tab',
		);
	}

	// Additional information tab - shows attributes.

	/**
	 * Filter to customize the display of dimensions for a product in its product page.
	 *
	 * @param bool $enable_dimensions_display True to enable dimensions display for the product.
	 *
	 * @since 2.0.14
	 */
	if ( ( $product instanceof WC_Product ) && ( $product->has_attributes() || apply_filters( 'wc_product_enable_dimensions_display', $product->has_weight() || $product->has_dimensions() ) ) ) {
		$tabs['additional_information'] = array(
			'title'    => __( 'Additional information', 'woocommerce' ),
			'priority' => 20,
			'callback' => 'woocommerce_product_additional_information_tab',
		);
	}

	// Reviews tab - shows comments.
	if ( comments_open() ) {
		$tabs['reviews'] = array(
			/* translators: %s: reviews count */
			'title'    => sprintf( __( 'Reviews (%d)', 'woocommerce' ), $product->get_review_count() ),
			'priority' => 30,
			'callback' => 'comments_template',
		);
	}

	return $tabs;
}