تابع ووکامرسی is_wc_endpoint_url بررسی اینکه آدرس Api نمایش داده می شود ؟

تابع ووکامرسی is_wc_endpoint_url – بررسی اینکه آدرس Api نمایش داده می شود ؟
Syntax – سینتکس
is_wc_endpoint_url( (bool) $endpoint = false );
Parameters – پارامتر ها (1)
- 1- $endpoint (bool)
Usage – نحوه استفاده
if ( !function_exists( 'is_wc_endpoint_url' ) ) {
require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-conditional-functions.php';
}
// The endpoint.
$endpoint = false;
// NOTICE! Understand what this does before running.
$result = is_wc_endpoint_url($endpoint);
Defined – محل تعریف
/includes/wc-conditional-functions.php
function is_wc_endpoint_url( $endpoint = false ) {
global $wp;
$wc_endpoints = WC()->query->get_query_vars();
if ( false !== $endpoint ) {
if ( ! isset( $wc_endpoints[ $endpoint ] ) ) {
return false;
} else {
$endpoint_var = $wc_endpoints[ $endpoint ];
}
return isset( $wp->query_vars[ $endpoint_var ] );
} else {
foreach ( $wc_endpoints as $key => $value ) {
if ( isset( $wp->query_vars[ $key ] ) ) {
return true;
}
}
return false;
}
}
versions – نسخه ها
از نسخه : 3.0.2
نسخه فعلی : 3.0.6
دیگر نسخه ها : 3.0.6 , 3.0.5 , 3.0.4 , 3.0.3 , 3.0.2
ارسال نظر