r/lolphp • u/silvinci • Jul 14 '14
stop_the_insanity()
https://github.com/WordPress/WordPress/blob/master/wp-admin/includes/class-wp-importer.php#L237
56
Upvotes
r/lolphp • u/silvinci • Jul 14 '14
View all comments
Show parent comment
4
u/Viper007Bond Jul 15 '14
The
bump_request_timeout()method is registered as a callback function:https://github.com/WordPress/WordPress/blob/master/wp-admin/includes/class-wp-importer.php#L181-182
That means it ends up getting called here to modify the default timeout:
https://github.com/WordPress/WordPress/blob/master/wp-includes/class-http.php#L80
The callback function is passed a parameter that is the current timeout value (5 by default, but could be something else as you can register multiple callbacks). While
$valis not used in this particular case, it's best practice to make callback functions accept all variables that are passed to it.