Changeset 6785 for trunk/src/includes/admin/classes/class-bbp-converter.php
- Timestamp:
- 02/19/2018 07:00:55 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/admin/classes/class-bbp-converter.php
r6681 r6785 216 216 217 217 // Maybe prepend the step 218 $progress = ! empty( $this->step ) 219 ? sprintf( '<span class="step">%s.</span><span class="output">%s</span><span class="mini-step">%s</span>', $this->step, $output, $this->step_percentage . '%' ) 220 : $output; 218 if ( ! empty( $this->step ) ) { 219 220 // Include percentage 221 if ( ! empty( $this->rows_in_step ) ) { 222 $progress = sprintf( '<span class="step">%s.</span><span class="output">%s</span><span class="mini-step">%s</span>', $this->step, $output, $this->step_percentage . '%' ); 223 224 // Don't include percentage 225 } else { 226 $progress = sprintf( '<span class="step">%s.</span><span class="output">%s</span>', $this->step, $output ); 227 } 228 229 // Raw text 230 } else { 231 $progress = $output; 232 } 221 233 222 234 // Output … … 428 440 */ 429 441 private function bump_start() { 442 443 // Set rows in step from option 444 $this->rows_in_step = get_option( '_bbp_converter_rows_in_step', 0 ); 445 446 // Get rows to start from 430 447 $start = (int) ( $this->start + $this->rows ); 431 448 449 // Enforce maximum if exists 450 if ( $this->rows_in_step > 0 ) { 451 452 // Start cannot be larger than total rows 453 if ( $start > $this->rows_in_step ) { 454 $start = $this->rows_in_step; 455 } 456 457 // Max can't be greater than total rows 458 if ( $this->max > $this->rows_in_step ) { 459 $this->max = $this->rows_in_step; 460 } 461 } 462 463 // Update the start option 432 464 update_option( '_bbp_converter_start', $start ); 433 465 } … … 467 499 } else { 468 500 $this->bump_start(); 469 $this->converter_response( sprintf( esc_html__( 'Deleting previously converted data (%1$s through %2$s of %3$s)', 'bbpress' ), $this->start, $this->max, $this->rows_in_step) );501 $this->converter_response( sprintf( esc_html__( 'Deleting previously converted data (%1$s through %2$s)', 'bbpress' ), $this->start, $this->max ) ); 470 502 } 471 503 … … 493 525 } else { 494 526 $this->bump_start(); 495 $this->converter_response( sprintf( 527 $this->converter_response( sprintf( esc_html__( 'Converting users (%1$s through %2$s of %3$s)', 'bbpress' ), $this->start, $this->max, $this->rows_in_step ) ); 496 528 } 497 529 } else { … … 516 548 } else { 517 549 $this->bump_start(); 518 $this->converter_response( sprintf( esc_html__( 'Delete default WordPress user passwords (%1$s through %2$s of %3$s)', 'bbpress' ), $this->start, $this->max, $this->rows_in_step) );550 $this->converter_response( sprintf( esc_html__( 'Delete default WordPress user passwords (%1$s through %2$s)', 'bbpress' ), $this->start, $this->max ) ); 519 551 } 520 552 } else {
Note: See TracChangeset
for help on using the changeset viewer.