Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Admin post meta contents
- function meta_guest_selection()
- {
- global $post;
- //include_once('helpers.php');
- $custom = get_post_custom($post->ID);
- $idealien_guest_selection = $custom["idealien_guest_selection"];
- ?>
- <style type="text/css">
- label.guest {
- font-weight: bold;
- width: 7.5em;
- float: left;
- }
- span.addInfo {
- margin-left: 7.5em;
- font-style: italic;
- }
- .guest_inputLine {
- width: 80%;
- float: left;
- }
- #wpcontent .select_inputLine { height: auto; }
- </style>
- <p>
- <label class="guest">Guest(s):</label>
- <?php // Get all guests (custom post type)
- /*
- $guestOptions = new WP_Query();
- $guestOptions->query('post_type=guest&posts_per_page=-1&orderby=title&order=ASC');
- if ($guestOptions->have_posts()) :
- echo "<select MULTIPLE='multiple' size=8 class='select_inputLine' name='idealien_guest_selection[]'>";
- while ($guestOptions->have_posts()) : $guestOptions->the_post();
- if (in_array(get_the_title(),$idealien_guest_selection)) {
- echo "<option SELECTED>" . get_the_title() . "</option>\n";
- } else {
- echo "<option>" . get_the_title() . "</option>\n";
- }
- endwhile;
- echo "</select>";
- endif;
- wp_reset_postdata();
- */
- //global $post;
- $args = array( 'post_type' => 'guest', 'posts_per_page'=> -1, 'orderby' => 'title' );
- $myposts = get_posts( $args );
- foreach( $myposts as $post ) : setup_postdata($post);
- echo '<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>';
- endforeach;
- wp_reset_postdata();
- ?>
- </p>
- <?php
- }
Add Comment
Please, Sign In to add comment