Closed benlk closed 8 years ago
$i
while
$paragraph_positions[$i] wasn't set when $i was equal to count($paragraph_positions) and ($i + 1 ) % $scaip_period == 0.
$paragraph_positions[$i]
count($paragraph_positions)
($i + 1 ) % $scaip_period == 0
This is because $paragraph_positions is zero-indexed and count( starts counting from 1, so it was an off-by-one error.
$paragraph_positions
count(
1
Changes
$i
used in the shortcode inserterwhile
loop to take care of an undefined variable notice (#17)Why
$paragraph_positions[$i]
wasn't set when$i
was equal tocount($paragraph_positions)
and($i + 1 ) % $scaip_period == 0
.This is because
$paragraph_positions
is zero-indexed andcount(
starts counting from1
, so it was an off-by-one error.