Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New Coder Jordann's Avatar
    Join Date
    Aug 2012
    New Zealand
    Thanked 4 Times in 4 Posts

    Wordpress Function

    I'm currently making a function for a custom post type on wordpress which is meant to show all the users in the database via a drop down box. the thing is its not working and is just showing a blank page when I look at the error_log there are no errors... Any help?

    PHP Code:
    function cpt_events_add() {
    // Noncename needed to verify where the data originated
            // Also creates the meta box
    echo '<input type="hidden" name="eventmeta_noncename" id="eventmeta_noncename" value="' .
    wp_create_nonceplugin_basename(__FILE__) ) . '" />';
    // Get the user data if its already been entered and also show the useres withing the database
    $add get_post_meta($post->ID'_add'true);
    $order 'user_nicename';
    $users $wpdb->get_results("SELECT * FROM $wpdb->users ORDER BY $order"); // query users
    echo '<select>';
    $users as $user) : // start users' profile "loop"
    echo '<option value="'$add .'" name="_add">.'<?php echo $user->user_firstname?>.'</option>';
        echo '</select>'; 
    There is a proper function for this which can be found here
    Last edited by Jordann; 10-19-2013 at 08:01 AM. Reason: Resolved


Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts