Changeset 1397 for sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/class-wporg-themes-upload.php
- Timestamp:
- 03/13/2015 12:04:27 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/class-wporg-themes-upload.php
r1385 r1397 525 525 public function create_or_update_theme_post( $ticket_id ) { 526 526 $upload_date = current_time( 'mysql' ); 527 $post_args = array( 528 'post_author' => $this->author->ID, 529 'post_title' => $this->theme->get( 'Name' ), 530 'post_name' => $this->theme_slug, 531 'post_content' => $this->theme->get( 'Description' ), 532 'post_parent' => $this->theme->post_parent, 533 'post_date' => $upload_date, 534 'comment_status' => 'closed', 535 'ping_status' => 'closed', 536 'post_type' => 'repopackage', 537 'tags_input' => $this->theme->get( 'Tags' ), 538 ); 539 540 // If we already have a post, update it. 527 528 // If we already have a post, get its ID. 541 529 if ( ! empty( $this->theme_post ) ) { 542 $post_args['ID'] = $this->theme_post->ID; 543 544 $post_id = wp_update_post( $post_args ); 545 546 // Otherwise create it for this new theme. 530 $post_id = $this->theme_post->ID; 531 532 // Otherwise create it for this new theme. 547 533 } else { 548 $post_id = wp_insert_post( $post_args ); 534 $post_id = wp_insert_post( array( 535 'post_author' => $this->author->ID, 536 'post_title' => $this->theme->get( 'Name' ), 537 'post_name' => $this->theme_slug, 538 'post_content' => $this->theme->get( 'Description' ), 539 'post_parent' => $this->theme->post_parent, 540 'post_date' => $upload_date, 541 'post_date_gmt' => $upload_date, 542 'comment_status' => 'closed', 543 'ping_status' => 'closed', 544 'post_type' => 'repopackage', 545 'tags_input' => $this->theme->get( 'Tags' ), 546 ) ); 549 547 } 550 548
Note: See TracChangeset
for help on using the changeset viewer.