pmpro_manage_users_custom_column

The Paid Memberships Pro pmpro manage users custom column function.

Description

pmpro_manage_users_custom_column( $column_data, (string) $column_name, $user_id ); 

Parameters (3)

0. $column_data
The column data.
1. $column_name (string)
The column name.
2. $user_id
The user id.

Usage

  1. if ( !function_exists( 'pmpro_manage_users_custom_column' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'paid-memberships-pro/includes/init.php'; 
  3.  
  4. // The column data. 
  5. $column_data = null; 
  6.  
  7. // The column name. 
  8. $column_name = ''; 
  9.  
  10. // The user id. 
  11. $user_id = null; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = pmpro_manage_users_custom_column($column_data, $column_name, $user_id); 
  15.  

Defined (1)

The function is defined in the following location(s).

/includes/init.php  
  1. function pmpro_manage_users_custom_column($column_data, $column_name, $user_id) { 
  2.  
  3. if($column_name == 'pmpro_membership_level') { 
  4. $levels = pmpro_getMembershipLevelsForUser($user_id); 
  5. $level_names = array(); 
  6. if(!empty($levels)) { 
  7. foreach($levels as $key => $level) 
  8. $level_names[] = $level->name; 
  9. $column_data = implode(', ', $level_names); 
  10. else 
  11. $column_data = __('None', 'paid-memberships-pro' ); 
  12. return $column_data;