problem with a custom field of user profile
-
Hi,
I’m creating a complex custom fields in user profile of my wordpress. Now, i have got a awesome complex fields in my user profile for select the option for my user…greaat !!. Here is my code of my complex field :
// Add field in user profile_personal_options Container::make('user_meta', 'Entité utilisateurs') ->add_fields(array( field::make('complex', 'crb_entite_utilisateurs') ->add_fields(array( Field::make('select', 'crb_select_users_entite', 'Entité assignée à l\'utilisateur') ->add_options( spm_list_entite() ) )) ));
But i want to retrieve this datas for put in my custom columns in admin user screen. First i create my custom column :
function modify_columns_users($columns) { return array_merge($columns, array( 'entite' => 'Entité' )); } add_filter('manage_users_columns', 'modify_columns_users');
then, i want to put this datas of complex fields in this custom columns. Here is my code :
function add_content_entite_users($value, $column_name, $user_id) { $user = carbon_get_user_meta( $user_id, 'crb_entite_utilisateurs' ); if($column_name == 'entite') { echo $user; } return $value; } add_filter('manage_users_custom_column', 'add_content_entite_users');
With this code i have got a error in my back office wordpress :
- Missing argument 2 for add_content_entite_users()
- Missing argument 3 for add_content_entite_users()
- Undefined variable: user_id
I don’t understand my mistake. Have you got an idea ?
thanks so lot
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘problem with a custom field of user profile’ is closed to new replies.