My host company doesn't have curl
extension enabled automatically, however, I'm able to load it using dl()
.
What will be the correct devote WordPress
to load the extension to ensure that it might use curl
for wp_remote_*
functions?
I'd want it to survive the potential upgrades of WordPress
code.
The first hook I understand of is init
. My recommendation is always to build this like a plug-in (to ensure that it'll survive upgrades) and perform the following:
add_action('init', 'load_curl_functions');
function load_curl_functions() {
//Use dl() to load curl
}
---- EDIT ----
It appears like you will find some hooks that fire before init
. I suggest attempting to hook to load_textdomain
rather. This is actually the hook that loads language and translation functions (the only real hook that fires earlier is muplugins_loaded
that might not operate in non-mu installations).
So: add_action('load_textdomain', 'load_curl_functions');
should load your curl extension before doing other things ...