تابع woocommerce_default_product_tabs افزودن تب یا زبانه جدید به صفحه محصول

تابع ووکامرسی woocommerce_default_product_tabs – افزودن تب یا زبانه جدید به صفحه محصول
Syntax – سینتکس
(array) woocommerce_default_product_tabs( (array) $tabs = array() );
Parameters – پارامتر ها (1)
- 1- $tabs (array)
Usage – نحوه استفاده
if ( !function_exists( 'woocommerce_default_product_tabs' ) ) {
require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-template-functions.php';
}
// The tabs.
$tabs = array();
// NOTICE! Understand what this does before running.
$result = woocommerce_default_product_tabs($tabs);
Defined – محل تعریف
/includes/wc-template-functions.php
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
if ( $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(
'title' => sprintf( __( 'Reviews (%d)', woocommerce ), $product->get_review_count() ),
'priority' => 30,
'callback' => 'comments_template',
);
}
return $tabs;
}
versions – نسخه ها
از نسخه : 3.0.2
نسخه فعلی : 3.0.6
دیگر نسخه ها : 3.0.6 , 3.0.5 , 3.0.4 , 3.0.3 , 3.0.2
ارسال نظر