Advertisement
Guest User

post selection

a guest
Jul 17th, 2012
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. // Pull all the posts into an array
  2. $options_posts = array();
  3. $options_posts_obj = get_posts('numberposts=999');
  4. $options_posts[''] = 'Select a post:';
  5. foreach ($options_posts_obj as $post) {
  6. $options_posts[$post->ID] = $post->post_title;
  7. }
  8.  
  9. $options[] = array(
  10. 'name' => __('Title Goes Here', 'options_check'),
  11. 'desc' => __('sub title?', 'options_check'),
  12. 'id' => 'post_select',
  13. 'type' => 'select',
  14. 'options' => $options_posts);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement