#4882 closed task (blessed) (invalid)
Publish a new post in a specific category
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.1.2 |
Component: | General | Keywords: | |
Focuses: | Cc: |
Description
Hi, please help me with this problem
I need to publish a new post in a specific category and use this code, but don't work.
<?php // PASO DE VARIABLES $title = $_POST['title']; $content = $_POST['textarea1']; $category = $_GET['cat']; $author = $user_ID; // create object class class wm_mypost { var $post_title; var $post_content; var $post_category; var $post_status; var $post_author; } //// my first object :-) $wm_myobject = new wm_mypost(); // fill object $wm_myobject->post_title = $title; $wm_myobject->post_content = $content; $wm_myobject->post_category = $category; $wm_myobject->post_status = 'publish'; $wm_myobject->post_author = $author; // feed object to wp_insert_post wp_insert_post($wm_myobject); ?>
Thanks.
Change History (3)
Note: See
TracTickets for help on using
tickets.
Closing as invalid for now.
Hi reus, WordPress.org is the component for the web site. You haven't described what version you are using in the bug report (and if it is 2.1 that isn't a maintained version), you haven't described what does happen and what you expect. Finally, your question would probably better for the wordpress.org/support forums until you have confirmed that it is buggy behavior. Hope that helps.