Skip to content

Commit

Permalink
Merge branch 'release/1.12.0' of https://github.com/pixelgrade/rosa2
Browse files Browse the repository at this point in the history
…into release/1.12.0
  • Loading branch information
madalingorbanescu committed Jul 12, 2021
2 parents a400592 + cb6555e commit 62b9d8e
Showing 1 changed file with 14 additions and 21 deletions.
35 changes: 14 additions & 21 deletions inc/upgrade/migrations/1.12.0-advanced-color-palettes.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,21 @@
exit;
}

// We need Customify to be active, not a surrogate that offers fallbacks like Style Manager 1.0 does.
if ( ! function_exists( 'PixCustomifyPlugin' ) || empty( PixCustomifyPlugin()->settings ) ) {
return;
}

$alphabet = range( 'A', 'Z' );

$color_control_ids = array(
'sm_color_primary',
'sm_color_secondary',
'sm_color_tertiary',
'color_1',
'color_2',
'color_3',
);

// consider shuffle setting
$shuffle = get_option( 'sm_shuffle_colors' );

if ( $shuffle === 'mixed' ) {
array_push( $color_control_ids, array_shift( $color_control_ids ) );
}

if ( $shuffle === 'remix' ) {
array_push( $color_control_ids, array_shift( $color_control_ids ) );
array_push( $color_control_ids, array_shift( $color_control_ids ) );
}

// consider color diversity
$diversity = get_option( 'sm_color_diversity' );
$diversity = pixelgrade_option( 'sm_color_diversity' );

if ( $diversity === 'low' ) {
array_splice( $color_control_ids, 1 );
Expand All @@ -39,14 +32,14 @@
$source = array();
$output = array();

$lighter = get_option( 'sm_light_primary_final' );
$light = get_option( 'sm_light_tertiary_final' );
$text_color = get_option( 'sm_dark_secondary_final' );
$dark = get_option( 'sm_dark_primary_final' );
$lighter = pixelgrade_option( 'color_light_1' );
$light = pixelgrade_option( 'color_light_3' );
$text_color = pixelgrade_option( 'color_dark_2' );
$dark = pixelgrade_option( 'color_dark_1' );

foreach ( $color_control_ids as $index => $control_id ) {

$value = get_option( $control_id . '_final' );
$value = pixelgrade_option( $control_id );

if ( empty( $value ) ) {
continue;
Expand Down

0 comments on commit 62b9d8e

Please sign in to comment.