- This topic has 3 replies, 4 voices, and was last updated 8 years, 2 months ago by
Scott.
Viewing 4 posts - 1 through 4 (of 4 total)
-
AuthorPosts
-
May 27, 2017 at 9:45 am #324896
James
This assumes that you are using GP Premium (Colors) and Elementor Page Builder
I expanded on
generate_default_color_palettes
because I wanted to integrate Elementor’s Global Colors and Color Picker colors with the GP Customizer color pickers.
In Elementor, select your Global color scheme, your Elementor Color Picker scheme (modify as desired), and this replaces your GP Customizer color picker swatches with Elementors.Open for comments, critisisms or suggestions. If I get time I might make this a plugin, or maybe one of the experts can :).
<?phpinclude_once( ABSPATH . 'wp-admin/includes/plugin.php' ); if ( is_plugin_active( 'elementor/elementor.php' && 'gp-premium/gp-premium.php' ) ) { add_filter( 'generate_default_color_palettes', 'elementor_global_color_palettes' ); function elementor_global_color_palettes( $palettes ) { // Some pickers seem to require we start our array with key[0] so we use array_values. $scheme_colors = array_values( get_option( 'elementor_scheme_color' ) ); $picker_colors = array_values( get_option( 'elementor_scheme_color-picker' ) ); /*** YOU CAN ONLY HAVE ONE INSTANCE OF $palettes UNCOMMENTED ***/ /* ************************************************** If you want all 12 colors from the Elementor Global Colors and Picker Colors */ //$palettes = array_merge( $scheme_colors, $picker_colors ); /* ************************************************** OR, If you have Elementor Global Colors disabled or just want the 8 colors from the Elementor Picker Colors */ //$palettes = $picker_colors ; /* ************************************************** Or, re-order, mix and match, comment out the ones you don't want. */ $palettes = array( $scheme_colors[3], $scheme_colors[1], $scheme_colors[2], $scheme_colors[0], //$picker_colors[0], //$picker_colors[1], //$picker_colors[2], //$picker_colors[3], $picker_colors[7], $picker_colors[5], $picker_colors[6], $picker_colors[4], ); return $palettes; } }May 27, 2017 at 11:49 pm #325056Tom
Lead DeveloperLead DeveloperVery cool – thank you for sharing! 🙂
July 19, 2017 at 11:09 am #351800Jose Pablo
This has made my life much easier. Thanks!
August 16, 2017 at 1:24 pm #367538Scott
This is fantastic. Thanks.
-
AuthorPosts
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.