Skip to content

Instantly share code, notes, and snippets.

@ChrisHardie
Created September 12, 2018 17:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChrisHardie/4979d28dd5bde9c5504336008fec8a42 to your computer and use it in GitHub Desktop.
Save ChrisHardie/4979d28dd5bde9c5504336008fec8a42 to your computer and use it in GitHub Desktop.
Override Jetpack development mode to activate modules for testing in WordPress
/**
* Modify Jetpack module properties for testing/development
*
* @param array $mod Module to look at modifying the properties of.
* @return boolean
*/
function jp_module_override( $mod ) {
switch ( $mod['name'] ) {
case 'Related posts':
$mod['requires_connection'] = false;
break;
}
return $mod;
}
add_filter( 'jetpack_get_module', 'jp_module_override' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment