تابع ووکامرسی wc_maybe_store_user_agent دریافت اطلاعات مرورگر کاربر

تابع ووکامرسی wc_maybe_store_user_agent دریافت اطلاعات مرورگر کاربر

تابع ووکامرسی wc_maybe_store_user_agent – دریافت اطلاعات مرورگر کاربر با توجه به تنظیمات ووکامرس

Syntax – سینتکس

wc_maybe_store_user_agent( $user_login, $user ); 

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

  • 1- $user_login
  • 2- $user

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

if ( !function_exists( 'wc_maybe_store_user_agent' ) ) { 
    require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-core-functions.php'; 
} 
  
// The user login. 
$user_login = null; 
  
// The user. 
$user = null; 
  
// NOTICE! Understand what this does before running. 
$result = wc_maybe_store_user_agent($user_login, $user); 
    

Defined – محل تعریف

/includes/wc-core-functions.php

function wc_maybe_store_user_agent( $user_login, $user ) { 
    if ( 'yes' === get_option( 'woocommerce_allow_tracking', 'no' ) && user_can( $user, 'manage_woocommerce' ) ) { 
        $admin_user_agents = array_filter( (array) get_option( 'woocommerce_tracker_ua', array() ) ); 
        $admin_user_agents[] = wc_get_user_agent(); 
        update_option( 'woocommerce_tracker_ua', array_unique( $admin_user_agents ) ); 
    } 
} 

versions – نسخه ها

از نسخه : 3.0.0

نسخه فعلی : 3.0.6

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

ارسال نظر

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

contact us