تابع ووکامرسی woocommerce_page_title نمایش عنوان صفحه مرتبط با ووکامرس

تابع ووکامرسی woocommerce_page_title – نمایش عنوان صفحه مرتبط با ووکامرس
Syntax – سینتکس
(string) woocommerce_page_title( (bool) $echo = true );
Parameters – پارامتر ها (1)
- 1- $echo (bool)
Usage – نحوه استفاده
if ( !function_exists( 'woocommerce_page_title' ) ) {
require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-template-functions.php';
}
// The echo.
$echo = true;
// NOTICE! Understand what this does before running.
$result = woocommerce_page_title($echo);
Defined – محل تعریف
/includes/wc-template-functions.php
function woocommerce_page_title( $echo = true ) {
if ( is_search() ) {
$page_title = sprintf( __( 'Search results: “%s”', woocommerce ), get_search_query() );
if ( get_query_var( 'paged' ) )
$page_title .= sprintf( __( ' – Page %s', woocommerce ), get_query_var( 'paged' ) );
} elseif ( is_tax() ) {
$page_title = single_term_title( "", false );
} else {
$shop_page_id = wc_get_page_id( 'shop' );
$page_title = get_the_title( $shop_page_id );
}
$page_title = apply_filters( 'woocommerce_page_title', $page_title );
if ( $echo )
echo $page_title;
else
return $page_title;
}
versions – نسخه ها
از نسخه : 3.0.2
نسخه فعلی : 3.0.6
دیگر نسخه ها : 3.0.6 , 3.0.5 , 3.0.4 , 3.0.3 , 3.0.2
ارسال نظر