Skip to content

Instantly share code, notes, and snippets.

View kevinchappell's full-sized avatar
🌠

Kevin Chappell kevinchappell

🌠
View GitHub Profile
<?php
/**
* Super simple class for logging. Generates regular logs and csv files
* @package lightLogger
* @author Kevin Chappell <[email protected]>
* @license http://opensource.org/licenses/MIT The MIT License (MIT)
* @since lightLogger .5
*/
/**
@kevinchappell
kevinchappell / get_user_data.php
Last active June 14, 2021 04:07
Get all User data in WordPress
<?php
/**
* Get an array of all user data
* @param string|int $user_id
* @return array merged array of user meta and data
*/
function get_user_data( $user_id ){
$user_data = (array) get_userdata( $user_id )->data;
$user_meta = array_map( function( $item ){ return $item[0]; }, (array) get_user_meta( $user_id ) );
return array_merge( $user_data, $user_meta );