[wp-hackers] row output on wp-admin/users.php

Claudio Simeone mrbrog at gmail.com
Mon Jul 20 20:35:06 UTC 2009

2009/7/19 Matt Mullenweg <m at mullenweg.com>:

>> add_action('manage_users_custom_column', my_user_cols_cc'); // this not
> You're missing an opening quote there -- is that in the original code or a
> copy/paste error?

hi Matt, the original code has the opening quote, I made a paste error
while I was writing the email.

> If your action function accepts multiple arguments, you need to tell
> add_action as well:
> http://codex.wordpress.org/Function_Reference/add_action

yes, my function accepts 2 arguments: the column_name and the user ID,
I told add_action this, and now it's working but in a different and
strange way:

so I did:

add_action('manage_users_custom_column', 'MY_user_cols_cc', 10, 3);

function MY_user_cols_cc($empty_var, $user_object, $column_name) {
strange thing #1:
$user_object contains the value of $column_name and
$column_name contains the value of $user_object

strange thing #2:
why I need to pass an empty variable as first argument?

if ($user_object == 'courses'){
  // do what you need
  $r .= "This user has this ID: $column_name";
return $r;

can you explain to me why this happens?
the function is hooked to this row in /wp-admin/includes/template.php row 1975
that has an empty argument (the second)

$r .= apply_filters('manage_users_custom_column', '', $column_name,

A final question: will this solution work in future versions of WP?


More information about the wp-hackers mailing list