تابع ووکامرسی woocommerce_wp_checkbox نمایش فیلد ورودی checkbox

تابع ووکامرسی woocommerce_wp_checkbox نمایش فیلد ورودی checkbox

تابع ووکامرسی woocommerce_wp_checkbox – نمایش فیلد ورودی checkbox

Syntax – سینتکس

woocommerce_wp_checkbox( (array) $field ); 

Parameters – پارامتر ها (1)

  • 1- $field (array)

Usage – نحوه استفاده

if ( !function_exists( 'woocommerce_wp_checkbox' ) ) { 
    require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/admin/wc-meta-box-functions.php'; 
} 
  
// The field. 
$field = array(); 
  
// NOTICE! Understand what this does before running. 
$result = woocommerce_wp_checkbox($field); 
    

Defined – محل تعریف

/includes/admin/wc-meta-box-functions.php

function woocommerce_wp_checkbox( $field ) { 
    global $thepostid, $post; 
 
    $thepostid = empty( $thepostid ) ? $post->ID : $thepostid; 
    $field['class'] = isset( $field['class'] ) ? $field['class'] : 'checkbox'; 
    $field['style'] = isset( $field['style'] ) ? $field['style'] : ''; 
    $field['wrapper_class'] = isset( $field['wrapper_class'] ) ? $field['wrapper_class'] : ''; 
    $field['value'] = isset( $field['value'] ) ? $field['value'] : get_post_meta( $thepostid, $field['id'], true ); 
    $field['cbvalue'] = isset( $field['cbvalue'] ) ? $field['cbvalue'] : 'yes'; 
    $field['name'] = isset( $field['name'] ) ? $field['name'] : $field['id']; 
    $field['desc_tip'] = isset( $field['desc_tip'] ) ? $field['desc_tip'] : false; 
 
    // Custom attribute handling 
    $custom_attributes = array(); 
 
    if ( ! empty( $field['custom_attributes'] ) && is_array( $field['custom_attributes'] ) ) { 
 
        foreach ( $field['custom_attributes'] as $attribute => $value ) { 
            $custom_attributes[] = esc_attr( $attribute ) . '="' . esc_attr( $value ) . '"'; 
        } 
    } 
 
    echo '

'; if ( ! empty( $field['description'] ) && false !== $field['desc_tip'] ) { echo wc_help_tip( $field['description'] ); } echo ' '; if ( ! empty( $field['description'] ) && false === $field['desc_tip'] ) { echo '' . wp_kses_post( $field['description'] ) . ''; } echo '

'; }

versions – نسخه ها

از نسخه : 3.0.2

نسخه فعلی : 3.0.6

دیگر نسخه ها : 3.0.6 , 3.0.5 , 3.0.4 , 3.0.3 , 3.0.2

ارسال نظر

جهت استفاده از کد حتما از تگ pre استفاده نمایید .

contact us