Available since: 2.4
searchwp_basic_auth_creds
In order to get around the limitations of PHP timeouts, its indexer operates by making a series of HTTP calls to itself. Unfortunately HTTP Basic Authentication prevents this process from working, so if you are using HTTP Basic Authentication on your site, you’ll need to tell SearchWP how to log in.
Example: To tell SearchWP your HTTP Basic Authentication credentials, add the following to your theme’s functions.php
:
NOTE: Use the HTTP Basic Authentication username and password NOT a WordPress login
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function my_searchwp_basic_auth_creds() { | |
// NOTE: this needs to be your HTTP BASIC AUTH login | |
// | |
// *** NOT *** your WordPress login | |
// | |
// | |
$credentials = array( | |
'username' => 'my_username', // the HTTP BASIC AUTH username | |
'password' => 'my_password' // the HTTP BASIC AUTH password | |
); | |
return $credentials; | |
} | |
add_filter( 'searchwp_basic_auth_creds', 'my_searchwp_basic_auth_creds' ); |