Skip to content

Instantly share code, notes, and snippets.

@vince844
Created October 15, 2017 18:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vince844/85f1bb816a56bdd57f90912702feb275 to your computer and use it in GitHub Desktop.
Save vince844/85f1bb816a56bdd57f90912702feb275 to your computer and use it in GitHub Desktop.
MyCred custom column for mycred_history log shortcode
// Add the following code to the functions.php code it will add a new column in the mycred_history with the user fisrt name and last name
function mycredpro_add_log_column( $columns ) {
// Add our own column
$columns['user-data'] = 'Utente';
return $columns;
}
add_filter( 'mycred_log_column_headers', 'mycredpro_add_log_column' );
function mycred_pro_user_data_content( $content, $entry ) {
$adjusted_by = get_userdata( (int) $entry->user_id );
if ( isset( $adjusted_by->ID ) )
return $adjusted_by->first_name.' '.$adjusted_by->last_name;
}
add_filter( 'mycred_log_user-data', 'mycred_pro_user_data_content', 10, 2 );
@GalileoGall
Copy link

Hi, do you know how to add this new column to the file that exports the log in csv?

Thanks in advance

Note: I'm not a programmer at all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment