Need idea: custom post type and custom meta

I’m working for a WordPress Plugin. The plugins is for library management, for my university. I created custom post types with taxonomies for keeping books information stored. Now I want to create another post type which will keep records for books and and users. For instance, I’ll create new post type called “Issue”. There should have three fields. One would be title. Another two will be dropdown, one will show all book (I’ve already created custom post type called books, I want to use those here, automatically) lists as dropdown. Another dropdown field will show list of students (for this I’ve created a new user role called student, I want to use those user who are registered as student).

So my questions are

Read More
  1. How can I show all users (selected role) as dropdown in custom meta box and
  2. How can I show all books (Custom post type I created) as dropdown in custom meta box

How can these be done? I can code, need instruction 😉

Related posts

Leave a Reply

2 comments

  1. Here is the code I used to create a dropdown of my Custom Post Type “Issues” to display the title of the “Issue” and have the value link to the single issue.

      <label>Published In:</label>
    
      <p><select name="issue-date">
      <?php 
      $args = array( 'post_type' => 'issues');
      $loop = new WP_Query( $args );
      while ( $loop->have_posts() ) : $loop->the_post();
    
      echo '<option value="';
      the_permalink();
      echo '">';
      the_title();
      echo '</option>';
      endwhile;
      ?>
    
      </p>
    

    Hope it helps someone.