Roots Discourse

Add_filter() is undefined inside config/environments/development.php

The following code inside config/environments/development.php:

define( 'WPSE54453_IS_LOCAL_SERVER', true );

// don't validate ssl cert for woo rest api requests using wp download_url
if (defined( 'WPSE54453_IS_LOCAL_SERVER' ) ) {
    add_filter( 'https_ssl_verify', '__return_false' );
}

causes:

Error: Call to undefined function add_filter() in …

How and where can i add the above code in Bedrock configuration files ?

Workaround that worked:

Config::define( 'WPSE54453_IS_LOCAL_SERVER', true ); in config/environments/development.php:

and

if (defined( 'WPSE54453_IS_LOCAL_SERVER' ) ) {
    add_filter( 'https_ssl_verify', '__return_false' );
}

in functions.php

This topic was automatically closed after 42 days. New replies are no longer allowed.