Skip to content

Instantly share code, notes, and snippets.

@Alimir
Created December 3, 2021 09:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Alimir/3190845f2e30d872aea274a97d40a526 to your computer and use it in GitHub Desktop.
Save Alimir/3190845f2e30d872aea274a97d40a526 to your computer and use it in GitHub Desktop.
provide the wp ulike with the HTTP request header that contains the real visitor IP
<?php
/**
* Add a custom HTTP request header to fix IP address detection
* @param \Geminilabs\Vectorface\Whip $whip
* @return void
*/
add_action('wp_ulike_whip_action', function ($whip) {
$customHeader = 'HTTP_X_SUCURI_CLIENTIP'; // change the header as needed
$whip->addCustomHeader($customHeader);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment