Skip to content

Instantly share code, notes, and snippets.

@PechenkiUA
Last active September 28, 2023 13:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PechenkiUA/b8679ee2570e54cd9673d9a4f47d25b5 to your computer and use it in GitHub Desktop.
Save PechenkiUA/b8679ee2570e54cd9673d9a4f47d25b5 to your computer and use it in GitHub Desktop.
User data Telsender
/**
* @param $list
* @param $order_id
* @return mixed
*/
function user_data_function($list, $order_id){
$user_id = get_current_user_id();
if ($user_id){
$list['{user_last_name}'] = get_user_meta( $user_id,'last_name',true);
$list['{user_nickname}'] = get_user_meta( $user_id,'nickname',true);
$list['{user_first_name}'] = get_user_meta( $user_id,'first_name',true);
}
return $list;
}
add_filter('tscf_filter_codetemplate', 'user_data_function', 20, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment