Per http://php.net/manual/en/info.configuration.php#ini.max-execution-time, yes, unless safe mode is enabled.
Setting max_execution_time per cron job
Question
I am running a particular WordPress cron job which takes a lot of time to complete as it does remote requests.
I want to increase the max_execution_time
of only this task.
If I use ini_set()
inside the cron function like the following will it work?
wp_schedule_event( time(), 'daily', 'cronjob' );
add_action( 'cronjob', 'cronjob_func' );
function cronjob_func() {
@ini_set( "max_execution_time", 600 );
//Rest of the code
}
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow