Skip to content
This repository has been archived by the owner on Sep 6, 2024. It is now read-only.

Commit

Permalink
Apply code styles
Browse files Browse the repository at this point in the history
  • Loading branch information
cleacos authored and oskosk committed Sep 18, 2020
1 parent e2729be commit 671a142
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 29 deletions.
55 changes: 28 additions & 27 deletions features/jetpack-crm-master.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,39 @@

define( 'JETPACK_CRM_PLUGIN_MASTER_URL', 'https://github.com/automattic/zero-bs-crm/archive/master.zip' );

add_action( 'jurassic_ninja_init', function() {
$defaults = [
'jetpack-crm-master' => false,
];
add_action( 'jurassic_ninja_init', function () {
$defaults = [
'jetpack-crm-master' => false,
];

add_action( 'jurassic_ninja_add_features_before_auto_login', function( &$app, $features, $domain ) use ( $defaults ) {
$features = array_merge( $defaults, $features );
if ( $features['jetpack-crm-master'] ) {
// Abort the installation from master if the public plugin is selected
if ( $features['zero-bs-crm'] ) {
return;
}
debug( '%s: Adding Jetpack CRM Plugin (master branch)', $domain );
add_jetpack_crm_master_plugin();
}
}, 10, 3 );
add_action( 'jurassic_ninja_add_features_before_auto_login', function ( &$app, $features, $domain ) use ( $defaults ) {
$features = array_merge( $defaults, $features );
if ( $features['jetpack-crm-master'] ) {
// Abort the installation from master if the public plugin is selected
if ( $features['zero-bs-crm'] ) {
return;
}
debug( '%s: Adding Jetpack CRM Plugin (master branch)', $domain );
add_jetpack_crm_master_plugin();
}
}, 10, 3 );

add_filter( 'jurassic_ninja_rest_create_request_features', function( $features, $json_params ) {
if ( isset( $json_params['jetpack-crm-master'] ) ) {
$features['jetpack-crm-master'] = $json_params['jetpack-crm-master'];
}
return $features;
}, 10, 2 );
add_filter( 'jurassic_ninja_rest_create_request_features', function ( $features, $json_params ) {
if ( isset( $json_params['jetpack-crm-master'] ) ) {
$features['jetpack-crm-master'] = $json_params['jetpack-crm-master'];
}

return $features;
}, 10, 2 );
} );

/**
* Installs and activates Jetpack CRM plugin (master branch) on the site.
*/
function add_jetpack_crm_master_plugin() {
$jetpack_crm_plugin_master_url = JETPACK_CRM_PLUGIN_MASTER_URL;
$cmd = "wp plugin install $jetpack_crm_plugin_master_url --activate";
add_filter( 'jurassic_ninja_feature_command', function ( $s ) use ( $cmd ) {
return "$s && $cmd";
} );
}
$jetpack_crm_plugin_master_url = JETPACK_CRM_PLUGIN_MASTER_URL;
$cmd = "wp plugin install $jetpack_crm_plugin_master_url --activate";
add_filter( 'jurassic_ninja_feature_command', function ( $s ) use ( $cmd ) {
return "$s && $cmd";
} );
}
2 changes: 1 addition & 1 deletion features/plugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
add_action( 'jurassic_ninja_init', function() {
$whitelist = [
'amp' => 'AMP',
'zero-bs-crm' => 'Jetpack CRM',
'zero-bs-crm' => 'Jetpack CRM',
'classic-editor' => 'Classic Editor',
'code-snippets' => 'Code Snippets',
'config-constants' => 'Config Constants',
Expand Down
2 changes: 1 addition & 1 deletion lib/stuff.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function require_feature_files() {
'/features/jetpack-beta.php',
'/features/wc-smooth-generator.php',
'/features/woocommerce-beta-tester.php',
'/features/jetpack-crm-master.php',
'/features/jetpack-crm-master.php',
'/features/wp-debug-log.php',
'/features/block-xmlrpc.php',
'/features/language.php',
Expand Down

0 comments on commit 671a142

Please sign in to comment.