Ticket #4079: draft-14.patch
| File draft-14.patch, 2.1 KB (added by , 20 years ago) |
|---|
-
app.php
261 261 262 262 var $ATOM_CONTENT_TYPE = 'application/atom+xml'; 263 263 var $CATEGORIES_CONTENT_TYPE = 'application/atomcat+xml'; 264 var $INTROSPECTION_CONTENT_TYPE = 'application/atoms erv+xml';264 var $INTROSPECTION_CONTENT_TYPE = 'application/atomsvc+xml'; 265 265 266 266 var $ENTRIES_PATH = "posts"; 267 267 var $CATEGORIES_PATH = "categories"; … … 409 409 } 410 410 411 411 $entry = $parser->entry; 412 $catnames = array(); 413 foreach($entry->categories as $cat) 414 array_push($catnames, $cat["term"]); 415 416 $wp_cats = get_categories(array('hide_empty' => false)); 412 417 418 $post_categories = array(); 419 420 foreach($wp_cats as $cat) { 421 if(in_array($cat->cat_name, $catnames)) 422 array_push($post_categories, $cat->cat_ID); 423 } 424 413 425 $publish = (isset($entry->draft) && trim($entry->draft) == 'yes') ? false : true; 414 426 415 427 $cap = ($publish) ? 'publish_posts' : 'edit_posts'; … … 425 437 $post_excerpt = $entry->summary; 426 438 $post_date = current_time('mysql'); 427 439 $post_date_gmt = current_time('mysql', 1); 440 if ( isset( $_SERVER['HTTP_SLUG'] ) ) 441 $post_name = $_SERVER['HTTP_SLUG']; 428 442 429 $post_data = compact('blog_ID', 'post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt' );443 $post_data = compact('blog_ID', 'post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'post_name'); 430 444 431 445 log_app('Inserting Post. Data:', print_r($post_data,true)); 432 446 … … 436 450 $this->internal_error('Sorry, your entry could not be posted. Something wrong happened.'); 437 451 } 438 452 453 // getting warning here about unable to set headers 454 // because something in the cache is printing to the buffer 455 // could we clean up wp_set_post_categories or cache to not print 456 // this could affect our ability to send back the right headers 457 @wp_set_post_categories($postID, $post_categories); 458 439 459 $output = $this->get_entry($postID); 440 460 441 461 log_app('function',"create_post($postID)");
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)