تابع ووکامرسی wc_page_endpoint_title جایگزینی عنوان صفحه با عنوان endpoint

تابع ووکامرسی wc_page_endpoint_title – جایگزینی عنوان صفحه با عنوان endpoint
Syntax – سینتکس
(string) wc_page_endpoint_title( (string) $title );
Parameters – پارامتر ها (1)
- 1- $title (string)
Usage – نحوه استفاده
if ( !function_exists( 'wc_page_endpoint_title' ) ) {
require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-page-functions.php';
}
// The title.
$title = '';
// NOTICE! Understand what this does before running.
$result = wc_page_endpoint_title($title);
Defined – محل تعریف
/includes/wc-page-functions.php
function wc_page_endpoint_title( $title ) {
global $wp_query;
if ( ! is_null( $wp_query ) && ! is_admin() && is_main_query() && in_the_loop() && is_page() && is_wc_endpoint_url() ) {
$endpoint = WC()->query->get_current_endpoint();
if ( $endpoint_title = WC()->query->get_endpoint_title( $endpoint ) ) {
$title = $endpoint_title;
}
remove_filter( 'the_title', 'wc_page_endpoint_title' );
}
return $title;
}
versions – نسخه ها
از نسخه : 3.0.2
نسخه فعلی : 3.0.6
دیگر نسخه ها : 3.0.6 , 3.0.5 , 3.0.4 , 3.0.3 , 3.0.2
ارسال نظر