Page 1 of 1

Adding custom member profile fields to signup moderation

PostPosted: February 23rd, 2011, 3:34 pm
by mctwisty
Hi,

Would like to know what I add to the code to add some custom signup fields into signiup moderation plugin v. 0.1.

Example: user's that signup have city, state and zip. How would i include that in this table with the php code below?

<table class="widefat">
<tbody>
<tr class="thead">
<th><?php _e('ID','wp-user-moderation') ?></th>
<th><?php _e('Username','wp-user-moderation') ?></th>
<th><?php _e('First Name','wp-user-moderation') ?></th>
<th><?php _e('Last Name','wp-user-moderation') ?></th>
<th><?php _e('E-mail','wp-user-moderation') ?></th>
<th colspan="2" style="text-align: center"><?php _e('Actions','wp-user-moderation') ?></th>
</tr>
</tbody>
<tbody>
<?php foreach($users as $user_object) : ?>
<tr class="alternate">
<td><?php echo $user_object->ID; ?></td>
<td><?php echo $user_object->user_login; ?></td>
<td><?php echo get_usermeta($user_object->ID,'first_name'); ?></td>
<td><?php echo get_usermeta($user_object->ID,'last_name'); ?></td>
<td><?php echo $user_object->user_email; ?></td>
<td><a href="<?php echo $_SERVER['PHP_SELF'];?>?page=WPUserMod&amp;userid=<?php echo $user_object->ID; ?>&amp;do=discard" class="edit"><?php _e('Discard','wp-user-moderation') ?></a></td>
<td><a href="<?php echo $_SERVER['PHP_SELF'];?>?page=WPUserMod&amp;userid=<?php echo $user_object->ID; ?>&amp;do=approve" class="edit"><?php _e('Approve','wp-user-moderation') ?></a></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>

Re: Adding custom member profile fields to signup moderation

PostPosted: February 23rd, 2011, 10:08 pm
by Cristián Lávaque
I'm not sure about that code, but I thought I'd ask if you already checked out the Custom Registration Fields with s2Member.

WP Admin -> s2Member -> General Options -> Custom Registration Fields

Re: Adding custom member profile fields to signup moderation

PostPosted: February 26th, 2011, 1:35 am
by mctwisty
I tried the code - see below:

Code: Select all

<div class="wrap">
      <h2><?php _e('Registration Requests Pending Approval','wp-user-moderation'); ?></h2>

      <?php if(!$users = $this->getPendingUsers()) : ?>
         <div class="error">
            <ul>
               <li><?php _e('No Pending Requests at this time for Approval...','wp-user-moderation'); ?></li>
            </ul>
         </div>
      <?php else : ?>
         <table class="widefat">
             <tbody>
               <tr class="thead">
                  <th><?php _e('ID','wp-user-moderation') ?></th>
                  <th><?php _e('Username','wp-user-moderation') ?></th>
   <th>City</th>
                  <th><?php _e('First Name','wp-user-moderation') ?></th>
                  <th><?php _e('Last Name','wp-user-moderation') ?></th>
                  <th><?php _e('E-mail','wp-user-moderation') ?></th>
                  <th colspan="2" style="text-align: center"><?php _e('Actions','wp-user-moderation') ?></th>
               </tr>
             </tbody>
             <tbody>
             <?php foreach($users as $user_object) : ?>
                <tr class="alternate">
                   <td><?php echo $user_object->ID; ?></td>
                  <td><?php echo $user_object->user_login; ?></td>
        <td><?php echo get_user_field("city"); ?></td>
                  <td><?php echo get_usermeta($user_object->ID,'first_name'); ?></td>
                  <td><?php echo get_usermeta($user_object->ID,'last_name'); ?></td>
                  <td><?php echo $user_object->user_email; ?></td>

                  <td><a href="<?php echo $_SERVER['PHP_SELF'];?>?page=WPUserMod&amp;userid=<?php echo $user_object->ID; ?>&amp;do=discard" class="edit"><?php _e('Discard','wp-user-moderation') ?></a></td>
                  <td><a href="<?php echo $_SERVER['PHP_SELF'];?>?page=WPUserMod&amp;userid=<?php echo $user_object->ID; ?>&amp;do=approve" class="edit"><?php _e('Approve','wp-user-moderation') ?></a></td>
               </tr>
            <?php endforeach; ?>
             </tbody>
         </table>
      <?php endif; ?>
   </div>





What i added:

Code: Select all
<th>City</th>

<td><?php echo get_user_field("city"); ?></td>





It doesn't pull any data from the database. I am really green, so I know its probably elementary, but I must be missing some statement to get it from a different table than what this plugin is pulling data from? Sorry if I sound really unclear.

Thanks!