Using Time Constants to set transient
Rather that '60*60*12` we can use `DAY_IN_SECONDS` which is equivalent of `60*60*24`. Let's use one day rather than (1/2)day as it seems better.
This commit is contained in:
parent
0e313e7b58
commit
18012b70c0
|
@ -264,7 +264,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||||
$version = preg_replace( '~[^0-9,.]~' , '' ,stristr( $cl_line , "version" ) );
|
$version = preg_replace( '~[^0-9,.]~' , '' ,stristr( $cl_line , "version" ) );
|
||||||
$update = trim( str_replace( "*" , "" , $cl_lines[ $line_num + 1 ] ) );
|
$update = trim( str_replace( "*" , "" , $cl_lines[ $line_num + 1 ] ) );
|
||||||
$version_data = array( 'date' => $date , 'version' => $version , 'update' => $update , 'changelog' => $changelog );
|
$version_data = array( 'date' => $date , 'version' => $version , 'update' => $update , 'changelog' => $changelog );
|
||||||
set_transient( md5( $plugin ) . '_version_data', $version_data, 60*60*12 );
|
set_transient( md5( $plugin ) . '_version_data', $version_data, DAY_IN_SECONDS );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue