Skip to content
Snippets Groups Projects
Commit b847a0f3 authored by Lucas García's avatar Lucas García
Browse files

feat: Add 'Accept-Language' header on http requests'

parent f0d2843d
No related branches found
No related tags found
No related merge requests found
<?php
function wpct_oc_user_locale()
{
$locale = apply_filters('wpml_current_language', null);
if (!$locale) {
$locale = 'ca';
}
return $locale;
}
function wpct_oc_accept_language_header()
{
$locale = wpct_oc_user_locale();
return $locale . ', ca;q=0.9, es;q=0.8, en;1=0.7';
}
......@@ -35,5 +35,6 @@ wpct_oc_check_dependencies();
function wpct_oc_set_headers($request_headers, $feed, $entry, $form)
{
$request_headers['API-KEY'] = wpct_oc_get_api_key();
$request_headers['Accept-Language'] = wpct_oc_accept_language_header();
return $request_headers;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment