Skip to content

Commit

Permalink
Merge pull request #125 from a8cteam51/add/wpcom-scrub-options
Browse files Browse the repository at this point in the history
Remove some options from scrubbing that are needed on WordPress.com
  • Loading branch information
Ninodevo authored Jul 11, 2024
2 parents 5748b38 + bcd1bc9 commit 8491bed
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions includes/scrub-options.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,20 @@ function( $v ) use ( $modules_to_disable ) {

update_option( 'safety_net_options_scrubbed', true );
}

/**
* Remove some options from scrubbing that are needed on WordPress.com.
*
* @param array $options_to_clear Options to clear.
*
* @return array
*/
function safety_net_scrub_options_wpcom( $options_to_clear ) {
if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {
$unset_wpcom_options = array( 'jetpack_private_options', 'jetpack_secrets', 'jetpack_active_modules' );
$options_to_clear = array_diff( $options_to_clear, $unset_wpcom_options );
}

return $options_to_clear;
}
add_filter( 'safety_net_options_to_clear', __NAMESPACE__ . '\safety_net_scrub_options_wpcom' );

0 comments on commit 8491bed

Please sign in to comment.