Changeset 5425 for trunk/src/includes/admin/converter.php
- Timestamp:
- 07/07/2014 01:51:38 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/admin/converter.php
r5424 r5425 468 468 break; 469 469 470 // STEP 9. C onvert tags.470 // STEP 9. Closed Topics. 471 471 case 9 : 472 if ( $converter->convert_topic_closed_topics( $start ) ) { 473 update_option( '_bbp_converter_step', $step + 1 ); 474 update_option( '_bbp_converter_start', 0 ); 475 if ( empty( $start ) ) { 476 $this->converter_output( __( 'No closed topics to close', 'bbpress' ) ); 477 } 478 } else { 479 update_option( '_bbp_converter_start', $max + 1 ); 480 $this->converter_output( sprintf( __( 'Calculating closed topics (%1$s - %2$s)', 'bbpress' ), $min, $max ) ); 481 } 482 483 break; 484 485 // STEP 10. Convert tags. 486 case 10 : 472 487 if ( $converter->convert_tags( $start ) ) { 473 488 update_option( '_bbp_converter_step', $step + 1 ); … … 483 498 break; 484 499 485 // STEP 1 0. Convert replies.486 case 1 0:500 // STEP 11. Convert replies. 501 case 11 : 487 502 if ( $converter->convert_replies( $start ) ) { 488 503 update_option( '_bbp_converter_step', $step + 1 ); … … 498 513 break; 499 514 500 // STEP 1 1. Convert reply_to parents.501 case 1 1:515 // STEP 12. Convert reply_to parents. 516 case 12 : 502 517 if ( $converter->convert_reply_to_parents( $start ) ) { 503 518 update_option( '_bbp_converter_step', $step + 1 ); … … 1129 1144 1130 1145 /** 1146 * This method converts old closed topics to bbPress closed topics. 1147 * 1148 * @since bbPress (r5425) 1149 * 1150 * @uses bbp_close_topic() to close topics properly 1151 * 1152 */ 1153 public function convert_topic_closed_topics( $start ) { 1154 1155 $has_update = false; 1156 1157 if ( !empty( $this->sync_table ) ) { 1158 $query = 'SELECT value_id, meta_value FROM ' . $this->sync_table_name . ' WHERE meta_key = "_bbp_old_closed_status_id" AND meta_value = "closed" LIMIT ' . $start . ', ' . $this->max_rows; 1159 } else { 1160 $query = 'SELECT post_id AS value_id, meta_value FROM ' . $this->wpdb->postmeta . ' WHERE meta_key = "_bbp_old_closed_status_id" AND meta_value = "closed" LIMIT ' . $start . ', ' . $this->max_rows; 1161 } 1162 1163 update_option( '_bbp_converter_query', $query ); 1164 1165 $closed_topic = $this->wpdb->get_results( $query ); 1166 1167 foreach ( (array) $closed_topic as $row ) { 1168 bbp_close_topic( $row->value_id ); 1169 $has_update = true; 1170 } 1171 1172 return ! $has_update; 1173 } 1174 1175 /** 1131 1176 * This method converts old reply_to post id to new bbPress reply_to post id. 1132 1177 *
Note: See TracChangeset
for help on using the changeset viewer.