Skip to content

Commit

Permalink
Jetpack: Enforce some modules.
Browse files Browse the repository at this point in the history
The `jetpack_active_modules` filter allows developers to enable/disable some modules in code. We might need to ensure some modules are always enabled/disabled and so we hook in to that filter ourselves.

At the moment, this just forces Vaultpress to be enabled. It won't have any effect until Automattic/jetpack#8465 is merged and released.
  • Loading branch information
philipjohn committed Jan 30, 2018
1 parent d3ced78 commit 0480f30
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions jetpack.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@ function wpcom_vip_log_updating_jetpack_version_option( $option_name, $option_va
add_action( 'pre_update_jetpack_option_version', 'wpcom_vip_log_updating_jetpack_version_option', 10, 2 );
}

/**
* Ensure some Jetpack modules are always enabled.
*/
function wpcom_vip_jetpack_active_modules( $active_modules ) {
return array_merge( $active_modules, [
'vaultpress',
] );
}
add_filter( 'jetpack_active_modules', 'wpcom_vip_jetpack_active_modules' );


if ( ! @constant( 'WPCOM_IS_VIP_ENV' ) ) {
add_filter( 'jetpack_is_staging_site', '__return_true' );
Expand Down

0 comments on commit 0480f30

Please sign in to comment.