質問: 'company' ) { return get_the_author_meta( 'company', $id ); } } add_action('wpmu_users_custom_column', 'add_custom_user_columns', 15, 3); この機能は、通常のユーザーリスト(ネットワークではない)で機能する機能から直接取得されます。 manage_users_columnsをwpmu_users_columnsに、manage_users_custom_columnをwpmu_users_custom_columnに置き換えました。ただし、ネットワークユーザーリストでは機能しません。
回答: これで、ネットワークユーザーテーブルに列を追加し、選択した列の前に列を追加し、それにデータを追加する必要があります。add_filter( 'wpmu_users_columns', 'my_awesome_new_column' ); add_action( 'manage_users_custom_column', 'my_awesome_column_data', 10, 3 ); // creates a new column in the network users table and puts it before a chosen column function my_awesome_new_column( $columns ) { return my_awesome_add_element_to_array( $columns, 'my-awesome-column', 'awesome', 'registered' ); } // adds data to our new column function my_awesome_column_data( $value, $column_name, $user_id ) { // if this our column, we return our data if ( 'my-awesome-column' == $column_name ) { return 'awesome user id ' . intval( $user_id ); } // if this is not any of our custom columns we just return the normal data return $value; } // adds a new element in an array on the exact place we want (if possible). function my_awesome_add_element_to_array( $original_array, $add_element_key, $add_element_value, $add_before_key ) { // this variable shows if we were able to add the element where we wanted $added = 0; // this will be the new array, it will include our element placed where we want $new_array = array(); // we go through all the current elements and we add our new element on the place we want foreach( $original_array as $key => $value ) { // we put the element before the key we want if ( $key == $add_before_key ) { $new_array[ $add_element_key ] = $add_element_value; // we were able to add the element where we wanted so no need to add it again later $added = 1; } // all the normal elements remain and are added to the new array we made $new_array[ $key ] = $value; } // if we failed to add the element earlier (because the key we tried to add it in front of is gone) we add it now to the end if ( 0 == $added ) { $new_array[ $add_element_key ] = $add_element_value; } // we return the new array we made return $new_array; }