diff --git a/bootstrap.php b/bootstrap.php index d1032cb..15a9893 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -49,6 +49,18 @@ function ( $value ) { } ); + // Auto-decrypt token when fetched via WP-CLI + if ( defined( 'WP_CLI' ) && WP_CLI ) { + add_filter( + 'option_nfd_data_token', + function ( $value ) { + $encryption = new Encryption(); + + return $encryption->decrypt( $value ); + } + ); + } + // Register activation hook add_action( 'newfold_container_set',