Monday 15 August 2011

wordpress - Saving data from frontend into the database -



wordpress - Saving data from frontend into the database -

i in middle of creating plugin. plugin shows on frontend end user. want info user enters saved database. created custom post type.

so looking how can save info entered form record in new custom form type? @ out of box functions / hooks should look?

can give me direction example?

thanks.

you're looking wp_insert_post(). in plugin, you'll want add together form processing. example:

$post = array( 'post_name' => 'some-slug', 'post_title' => 'some title', 'post_status' => 'draft', 'post_type' => 'custom_post_type' ); wp_insert_post( $post );

wordpress

No comments:

Post a Comment