Add additional keys to WP Remote

/**
 * Add aditional API keys
 */
add_filter('wpr_api_keys', 'vendi__wpr_api_keys');
function vendi__wpr_api_keys($keys){
    if(!is_array($keys)){
        $keys = (array)$keys;    //The stored key is probably a string literal so turn it into an array
    }
    $keys[] = 'SECOND_KEY_HERE'; //Make a note so you know what it was
    $keys[] = 'THIRD_KEY_HERE';  //Make a note so you know what it was
    return $keys;                //Return the above changes
}

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.