Skip to content

Commit

Permalink
Decrypt token when calling wp option get nfd_data_token from WP-CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
wpscholar committed Mar 7, 2023
1 parent 643aff9 commit f3b077f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit f3b077f

Please sign in to comment.