تابع ووکامرسی wc_query_string_form_fields نمایش ورودی های مخفی کوئری استرینگ

تابع ووکامرسی wc_query_string_form_fields – نمایش ورودی های مخفی کوئری استرینگ
Syntax – سینتکس
wc_query_string_form_fields( (constant) $values = null, (array) $exclude = array(), (string) $current_key = '', (bool) $return = false );
Parameters – پارامتر ها (4)
- 1- $values (constant)
- 2- $exclude (array)
- 3- $current_key (string)
- 4- $return (bool)
Usage – نحوه استفاده
if ( !function_exists( 'wc_query_string_form_fields' ) ) {
require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-template-functions.php';
}
// Name value pairs.
$values = null;
// Keys to exclude.
$exclude = array();
// Current key we are outputting.
$current_key = '';
// The return.
$return = false;
// NOTICE! Understand what this does before running.
$result = wc_query_string_form_fields($values, $exclude, $current_key, $return);
Defined – محل تعریف
/includes/wc-template-functions.php
function wc_query_string_form_fields( $values = null, $exclude = array(), $current_key = '', $return = false ) {
if ( is_null( $values ) ) {
$values = $_GET;
}
$html = '';
foreach ( $values as $key => $value ) {
if ( in_array( $key, $exclude, true ) ) {
continue;
}
if ( $current_key ) {
$key = $current_key . '[' . $key . ']';
}
if ( is_array( $value ) ) {
$html .= wc_query_string_form_fields( $value, $exclude, $key, true );
} else {
$html .= '';
}
}
if ( $return ) {
return $html;
} else {
echo $html;
}
}
versions – نسخه ها
از نسخه : 3.0.0
نسخه فعلی : 3.0.6
دیگر نسخه ها : 3.0.6 , 3.0.5 , 3.0.4 , 3.0.3 , 3.0.2
ارسال نظر