Skip to content

Commit

Permalink
moving code to 2.4.22
Browse files Browse the repository at this point in the history
  • Loading branch information
manikantakailasa committed Apr 11, 2024
1 parent fcfe363 commit 857f9fe
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 24 deletions.
23 changes: 0 additions & 23 deletions bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,29 +138,6 @@ function nfd_create_event_queue_table() {
dbDelta( $sql );
}

/**
* Update affiliation code in option table
*
* @param object $container Container information
*/
function nfd_update_options_table( $container ) {
$brand_code = array(
'bluehost' => '86241',
'hostgator' => '57686',
'web' => '86239',
'crazy-domains' => '57687',
'default' => '86240',
);
$brand = $container->plugin()->id;
if ( is_plugin_active( 'jetpack/jetpack.php' ) ) {
if ( empty( $brand ) || ! array_key_exists( $brand, $brand_code ) ) {
$brand = 'default';
}
$jetpack_affiliate_code = get_option( 'jetpack_affiliate_code' );
! $jetpack_affiliate_code && update_option( 'jetpack_affiliate_code', $brand_code[ $brand ] );
}
}

/**
* Drop the event queue table
*/
Expand Down
16 changes: 15 additions & 1 deletion upgrades/2.4.22.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,20 @@
add_action(
'newfold_container_set',
function ( Container $container ) {
nfd_update_options_table( $container );
$brand_code = array(
'bluehost' => '86241',
'hostgator' => '57686',
'web' => '86239',
'crazy-domains' => '57687',
'default' => '86240',
);
$brand = $container->plugin()->id;
if ( is_plugin_active( 'jetpack/jetpack.php' ) ) {
if ( empty( $brand ) || ! array_key_exists( $brand, $brand_code ) ) {
$brand = 'default';
}
$jetpack_affiliate_code = get_option( 'jetpack_affiliate_code' );
! $jetpack_affiliate_code && update_option( 'jetpack_affiliate_code', $brand_code[ $brand ] );
}
}
);

0 comments on commit 857f9fe

Please sign in to comment.