Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow configuration via a constant #30

Open
totallyben opened this issue May 15, 2020 · 0 comments
Open

Allow configuration via a constant #30

totallyben opened this issue May 15, 2020 · 0 comments

Comments

@totallyben
Copy link

To support our set up we have to make the following code change to allow us to manage custom ips via the constant WP_ROCKET_VARNISH_CUSTOM_IPS.

Would it be possible to include this update in the next release as might be helpful for others?

function set_custom_varnish_ip( $ips ) {

    $ips[] = '127.0.0.1';	// Enter your custom Varnish IP here
    // $ips[] = '13.1.2.3';	// Add each new IP as a new line

    // add any ips specified by WP_ROCKET_VARNISH_CUSTOM_IPS
    if (defined('WP_ROCKET_VARNISH_CUSTOM_IPS')) {
        $ips = array_merge(
            $ips,
            explode(',', str_replace(' ', '', WP_ROCKET_VARNISH_CUSTOM_IPS))
        );
    }
	
    return $ips;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant