Skip to content

Commit ca7d27a

Browse files
committed
Use wp_rand instead of rand
1 parent 3ba153e commit ca7d27a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

includes/Generator/Term.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public static function generate( $save = true, string $taxonomy = 'product_cat',
5858
}
5959

6060
$term_args = array(
61-
'description' => self::$faker->realTextBetween( 20, rand( 20, 300 ), 4 ),
61+
'description' => self::$faker->realTextBetween( 20, wp_rand( 20, 300 ), 4 ),
6262
);
6363
if ( 0 !== $parent ) {
6464
$term_args['parent'] = $parent;
@@ -230,7 +230,7 @@ protected static function batch_hierarchical( int $amount, string $taxonomy, arr
230230
} else {
231231
// Subsequent hierarchy levels.
232232
foreach ( $levels[ $i - 1 ] as $term_id ) {
233-
$tcount = rand( 0, $term_max );
233+
$tcount = wp_rand( 0, $term_max );
234234

235235
for ( $j = 1; $j <= $tcount && $remaining > 0; $j ++ ) {
236236
$term = self::generate( true, $taxonomy, $term_id );

0 commit comments

Comments
 (0)