Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author radiok

    (@radiok)

    Unfortunately, there isn’t any mechanism in place for that as yet. There is a plugin, Codepress Admin Columns that I’ve been looking to “borrow” from in regard to this. Actually, I’d be curious to see if there’s someway to get that plugin to accomplish just this. I’ll try it out on a test site and let you know.

    Thread Starter aaronrobb

    (@aaronrobb)

    Radiok,

    I figured it out. Fairly easy actually.

    I took the field name created in the custom area (mine was ‘rpr_clinic_name’), and just pushed it into a new table section of the admin page(rpr-admin-menu.php) using the class from email:

    <table class="widefat fixed" cellspacing="0">
    					<thead>
    						<tr class="thead">
    							<th scope="col" id="cb" class="manage-column column-cb check-column" style=""><input type="checkbox" /></th>
    							<th scope="col" id="clinic" class="manage-column column-email" style=""><?php _e( 'Clinic', 'register-plus-redux' ); ?></th>

    then

    <tbody id="users" class="list:user user-list">
    						<?php
    						/*.object.*/ $user_query = new WP_User_Query( array( 'role' => 'rpr_unverified' ) );
    						if ( !empty( $user_query->results ) ) {
    							$style = '';
    							foreach ( $user_query->results as $user ) {
    								$style = ( $style == ' class="alternate"' ) ? '' : ' class="alternate"';
    								?>
    								<tr id="user-<?php echo $user->ID; ?>"<?php echo $style; ?>>
    									<th scope="row" class="check-column"><input type="checkbox" name="users[]" id="user_<?php echo $user->ID; ?>" name="user_<?php echo $user->ID; ?>" value="<?php echo $user->ID; ?>"></th>
    									<td class="username column-username">
    										<strong><?php if ( current_user_can( 'edit_users' ) )    echo                         '<a href="', esc_url(      add_query_arg( array(                                                                      'user_id' => $user->ID, 'wp_http_referer' => urlencode( stripslashes( $_SERVER['REQUEST_URI'] ) ) ), 'user-edit.php')                                        ), '"                     >', $user->user_login,                    '</a>'; else echo $user->user_login; ?></strong><br />
    										<div class="row-actions">
    											<?php if ( current_user_can( 'promote_users' ) ) echo '<span class="edit">     <a href="', wp_nonce_url( add_query_arg( array( 'page' => 'unverified-users', 'action' => 'approve_user',            'user_id' => $user->ID, 'wp_http_referer' => urlencode( stripslashes( $_SERVER['REQUEST_URI'] ) ) ), 'users.php'),    'register-plus-redux-unverified-users' ), '"                     >', __( 'Approve', 'register-plus-redux' ),           '</a></span> | ', "\n"; ?>
    											<?php                                            echo '<span class="edit">     <a href="', wp_nonce_url( add_query_arg( array( 'page' => 'unverified-users', 'action' => 'send_verification_email', 'user_id' => $user->ID, 'wp_http_referer' => urlencode( stripslashes( $_SERVER['REQUEST_URI'] ) ) ), 'users.php'),    'register-plus-redux-unverified-users' ), '"                     >', __( 'Send Verification', 'register-plus-redux' ), '</a></span>   ', "\n"; ?>
    											<?php if ( current_user_can( 'delete_users' ) )  echo '<span class="delete"> | <a href="', wp_nonce_url( add_query_arg( array( 'page' => 'unverified-users', 'action' => 'delete_user',             'user_id' => $user->ID, 'wp_http_referer' => urlencode( stripslashes( $_SERVER['REQUEST_URI'] ) ) ), 'users.php'),    'register-plus-redux-unverified-users' ), '" class="submitdelete">', __( 'Delete', 'register-plus-redux' ),            '</a></span>   ', "\n"; ?>
    										</div>
    									</td>
    									<td class="email column-email"><?php echo $user->rpr_clinic_name; ?></td>

    And viola! it shows the custom field. I would probably take out one of the other table columns as it does start to get full fast if exact spacing isn’t set up.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Show custom field in Unverified User Screen’ is closed to new replies.