| @@ 203-215 (lines=13) @@ | ||
| 200 | $max_num_pages = (int) $donation_posts->max_num_pages; |
|
| 201 | ||
| 202 | // Check current page is less then max number of page or not |
|
| 203 | if ( $paged < $max_num_pages ) { |
|
| 204 | // Update the curretn page virable for the next step |
|
| 205 | $this->update_option( $this->step_on_key, $paged ); |
|
| 206 | ||
| 207 | // Calculating percentage. |
|
| 208 | $page_remain = $max_num_pages - $paged; |
|
| 209 | $this->total_step = (int) $max_num_pages + ( $total_donation / $this->per_step ) + ( ( $page_remain * 2 ) * count( $donor_ids ) ); |
|
| 210 | $this->step_completed = $paged; |
|
| 211 | } else { |
|
| 212 | $donation_ids_count = count( $donor_ids ); |
|
| 213 | $this->update_option( $this->step_key, 'donation' ); |
|
| 214 | $this->update_option( $this->step_on_key, '0' ); |
|
| 215 | } |
|
| 216 | ||
| 217 | $donor_ids = array_unique( $donor_ids ); |
|
| 218 | $this->update_option( $this->donor_key, $donor_ids ); |
|
| @@ 266-278 (lines=13) @@ | ||
| 263 | $max_num_pages = (int) $donation_posts->max_num_pages; |
|
| 264 | ||
| 265 | // Check current page is less then max number of page or not. |
|
| 266 | if ( $paged < $max_num_pages ) { |
|
| 267 | ||
| 268 | // Update the current page variable for the next step. |
|
| 269 | $this->update_option( $this->step_on_key, $paged ); |
|
| 270 | ||
| 271 | // Calculating percentage. |
|
| 272 | $page_remain = $max_num_pages - $paged; |
|
| 273 | $this->total_step = (int) $max_num_pages + ( $total_donation / $this->per_step ) + ( ( $page_remain * 2 ) * count( $donor_ids ) ); |
|
| 274 | $this->step_completed = $paged; |
|
| 275 | } else { |
|
| 276 | $donation_ids_count = count( $donor_ids ); |
|
| 277 | $this->update_option( $this->step_key, 'donation' ); |
|
| 278 | $this->update_option( $this->step_on_key, '0' ); |
|
| 279 | } |
|
| 280 | ||
| 281 | $donor_ids = array_unique( $donor_ids ); |
|