Changeset 10637 for sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/class-wporg-themes-upload.php
- Timestamp:
- 02/03/2021 04:40:24 AM (4 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
r10635 r10637 674 674 $this->trac_ticket = new StdClass; 675 675 676 $this->trac_ticket->resolution = ''; 677 676 678 // todo - check trac xml-rpc, maybe data needs to be escaped before sending it there. 677 679 $this->trac_ticket->summary = sprintf( 'THEME: %1$s – %2$s', $this->theme->display( 'Name' ), $this->theme->display( 'Version' ) ); … … 860 862 // Note that this only applies to new ticket creation, so it won't happen on themes with existing outstanding tickets 861 863 if ( ! $theme_is_older_than_two_years && $this->trac_ticket->priority == 'theme update' ) { 862 $this->trac->ticket_update( $ticket_id, 'Theme Update for existing Live theme - automatically reviewed', array( 'action' => 'review' ), false ); 863 $this->trac->ticket_update( $ticket_id, 'Theme Update for existing Live theme - automatically approved', array( 'action' => 'approve_and_live' ), false ); 864 $this->trac->ticket_update( $ticket_id, 'Theme Update for existing Live theme - automatically reviewed & approved', array( 'action' => 'new_no_review' ), false ); 865 866 $this->trac_ticket->resolution = 'live'; 864 867 } 865 868 … … 920 923 } 921 924 922 // Discard versions that are awaiting review.923 wporg_themes_update_version_status( $post_id, $this->theme->get( 'Version' ), 'new' );924 925 925 // Add an additional row with the trac ticket ID, to make it possible to find the post by this ID later. 926 926 add_post_meta( $post_id, sanitize_key( '_trac_ticket_' . $this->theme->get( 'Version' ) ), $ticket_id ); 927 928 // Discard versions that are awaiting review, and maybe set this upload as live. 929 $version_status = 'new'; 930 if ( ! empty( $this->trac_ticket->resolution ) && 'live' === $this->trac_ticket->resolution ) { 931 $version_status = 'live'; 932 } 933 wporg_themes_update_version_status( $post_id, $this->theme->get( 'Version' ), $version_status ); 927 934 } 928 935 … … 1011 1018 public function send_email_notification( $ticket_id ) { 1012 1019 if ( ! empty( $this->theme_post ) ) { 1020 1021 if ( 1022 ! empty( $this->trac_ticket->resolution ) && 1023 'live' === $this->trac_ticket->resolution 1024 ) { 1025 // Do nothing. The update has been set as live. No nee to let them know it's been uploaded. 1026 // wporg_themes_approve_version() will send a "Congratulations! It's live!" email momentarily. 1027 return; 1028 } 1029 1013 1030 /* translators: 1: theme name, 2: theme version */ 1014 1031 $email_subject = sprintf( __( '[WordPress Themes] %1$s, new version %2$s', 'wporg-themes' ),
Note: See TracChangeset
for help on using the changeset viewer.