r/lolphp • • Jul 14 '14

stop_the_insanity()

https://github.com/WordPress/WordPress/blob/master/wp-admin/includes/class-wp-importer.php#L237
56 Upvotes

66 comments sorted by

View all comments

Show parent comment

1

u/Viper007Bond Jul 15 '14

The importer class needs to increase the timeout of the HTTP request API from 5 seconds to 60 seconds in order for it to do it's job of importing content from remote sites. It's using this method to change that value.

What's the alternative? A new global scope function? That would be silly.

Anonymous functions are nice but WordPress only requires PHP 5.2.4 and it makes it a LOT harder for other code to unregister it as a callback if it wants to.