[wp-trac] [WordPress Trac] #12976: Add get_post_content()/get_post_excerpt() and save_postdata()/restore_postdata() for support.

WordPress Trac wp-trac at lists.automattic.com
Mon Apr 12 18:45:15 UTC 2010


#12976: Add get_post_content()/get_post_excerpt() and
save_postdata()/restore_postdata() for support.
--------------------------+-------------------------------------------------
 Reporter:  mikeschinkel  |       Owner:            
     Type:  enhancement   |      Status:  new       
 Priority:  normal        |   Milestone:  Unassigned
Component:  Post Types    |     Version:  3.0       
 Severity:  normal        |    Keywords:            
--------------------------+-------------------------------------------------

Comment(by filosofo):

 Innumerable times I have to do something like the following just to get
 filtered content when the global variable stars aren't aligning just
 right:

 {{{
 $_post_obj = get_post($post_id);
 echo apply_filters('the_content', $_post_obj->post_content);
 }}}

 And just try to do a custom-sized excerpt, using existing functions, in a
 way that makes any kind of sense.

 What we need is something that you can pass an object ID to and return the
 excerpt or content, filtered. We don't need all those global dependencies,
 which are vestiges of the bad old days.

 I've sat down to work on this problem before, but the backwards-
 compatibility issues have made me reach for the Tums instead.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/12976#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list