[wp-hackers] Custom Post - implementation specifics

Stephen Rider wp-hackers at striderweb.com
Thu Dec 3 23:08:23 UTC 2009


On Dec 3, 2009, at 4:52 PM, Stephen Rider wrote:

> On Dec 3, 2009, at 4:43 PM, Eric Marden wrote:
> 
>> What do you mean by the full post API? What can't you do with wp_insert_post, wp_update_post, wp_delete_post, get_post, get_posts, add_post_meta, update_post_meta, delete_post_meta, and friends?
> 
> Creating a core create_edit_page() function of some sort.  Quoting myself:
> 
> "I need an edit page for Post Type X.  It needs (for example) the Main Text Box, Tags, and Excerpt.  Bang!  Done."
> On Dec 3, 2009, at 1:41 PM, Stephen Rider wrote:

in separate email:
>> What we need are more functions like the_editor() that make adding different parts of the screen(s) to the page, without copying a lot of markup.

Eric -- this suggests a good approach.  Instead of one mega-"add edit page" function, perhaps simply make it so every stock edit page element has a small function that creates it.  Thus the code that creates the standard Edit Post page might simply look like:

create_editor();
create_excerpt_box();
create_custom_field_box();
create_pingbacks_box();
...etc.

or maybe better:

editor_element('editor');
editor_element('excerpt');
editor_element('custom_fields');
editor_element('pingbacks');

Question for those more familiar:  What functions of this type already exist?  I don't mean the generic add_meta(), I mean dedicated functions for editor elements....

Stephen



-- 
Stephen Rider
http://striderweb.com/



More information about the wp-hackers mailing list