Top

rjshuttleworth on "Accessing posts in the trash from PHP"

May 3, 2010 by David Olsen 

Hi all, (my first post)

I am trying to access posts from PHP that are in the trash. I know I can return content of a trashed post when I know the ID of the post, as I can use:

$post = get_post($id);
echo $post->post_title;

after issuing a: wp_delete_post($id);

but I’d like to be able to produce a list of trashed items for use in my site. Can anyone point me in the right direction? Ideally there’ll be some metadata that I can pull that I don’t know about yet, and that my google searches are failing to uncover! I’m effectively trying to select all posts in the trash for a particular author.

Thanks all!
R

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • NewsVine
  • Reddit
  • StumbleUpon
  • Google Bookmarks
  • Yahoo! Buzz
  • Twitter
  • Technorati
  • Live
  • LinkedIn
  • MySpace
  • Share/Bookmark

Related posts:

  1. mariostella on "php query in post" Hi, I downloaded the plugin to execute php in post,...
  2. s7orm on "Thumbnails wont show up in a category?" <?php get_header(); ?> <?php $blog_cat = html_entity_decode(get_option('T_blog_cat')); $blog_ID = get_cat_ID($blog_cat);...
  3. adamgay on "Problems displaying specific categories" This is probably just some little mistake, or something I’m...
  4. eighteesix on "issue with older entries" Hope somebody can tell me what is wrong here. This...
  5. erikturner on "Image.php to show "full" instead of "medium" for WP Gallery" I had a separate post running, but I think it...

Related posts brought to you by Yet Another Related Posts Plugin.

Comments

Facebook comments:

Feel free to leave a comment...
and oh, if you want a pic to show with your comment, go get a gravatar!





Security Code:

Bottom