• Resolved randyd

    (@randyd)


    I’m using WP 2.2.
    Logging in as administrator, on the “Authors & Users” page (wp-admin/users.php) my users are listed under “Users List by Role”. Then I have the table that holds the data of each user. The headings are ID, Username, Name, E-mail, Website, Actions.

    I want to add an addition heading of “Status” and grab that data from the users (wp_users) table in the database. I’ve already added the field (and data) in wp_users that holds the data that I want to grab, but in users.php, I’m not sure how to do it.

    In users.php the table that holds the heading and data starts at or near line 375 (see code below).

    I’ve added the heading (Status), but how would I get the new “Status” data to appear for each user?

    Thanks for your help.

    Code:

    <table class="widefat">
    <?php
    foreach($roleclasses as $role => $roleclass) {
    	uksort($roleclass, "strnatcasecmp");
    ?>
    <tbody>
    <tr>
    <?php if ( !empty($role) ) : ?>
    	<th colspan="8"><h3><?php echo $wp_roles->role_names[$role]; ?></h3></th>
    <?php else : ?>
    	<th colspan="8"><h3><em><?php _e('No role for this Site'); ?></h3></th>
    <?php endif; ?>
    </tr>
    <tr class="thead">
    	<th><?php _e('ID') ?></th>
    	<th><?php _e('Username') ?></th>
    	<th><?php _e('Name') ?></th>
    	<th><?php _e('E-mail') ?></th>
    	<th><?php _e('Website') ?></th>
    <th colspan="2" style="text-align: center"><?php _e('Actions') ?></th>
    <th><?php _e('Status') ?></th>
    
    </tr>
    </tbody>
    <tbody id="role-<?php echo $role; ?>"><?php
    $style = '';
    foreach ( (array) $roleclass as $user_object ) {
    	$style = ( ' class="alternate"' == $style ) ? '' : ' class="alternate"';
    	echo "\n\t" . user_row($user_object, $style);
    }
    ?>
    
    </tbody>
    <?php } ?>
    </table>

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Adding a Field in Admin/Users’ is closed to new replies.