@@ -122,7 +122,9 @@ public function register_color_schemes() {
122122 );
123123 }
124124
125- public function sanitize_array_setting ( $ input ) {
125+ // Make this function static so it can be used when
126+ // registering the custom color schemes in premium
127+ public static function sanitize_array_setting ( $ input ) {
126128 return ! is_array ( $ input ) ? array ( array () ) : $ input ;
127129 }
128130
@@ -179,7 +181,7 @@ public function add_global_color_schemes_styles( $current_css ) {
179181 $ schemes_array = is_array ( get_option ( 'stackable_global_color_schemes ' ) ) ? get_option ( 'stackable_global_color_schemes ' ) : [];
180182
181183 // Get all color schemes, including custom color schemes if any
182- $ all_color_schemes = apply_filters ( 'stackable_global_color_schemes. get_color_schemes ' , $ schemes_array );
184+ $ all_color_schemes = apply_filters ( 'stackable_global_color_schemes/ get_color_schemes ' , $ schemes_array );
183185
184186 if ( ! is_array ( $ all_color_schemes ) ) {
185187 return $ current_css ;
@@ -231,16 +233,16 @@ public function add_global_color_schemes_styles( $current_css ) {
231233 'key ' => $ key ,
232234 'mode ' => 'background ' ,
233235 'selectors ' => array (
234- 'desktop ' => ".background- $ key " ,
235- 'desktopParentHover ' => ":where(.stk-hover-parent:hover) .background- $ key "
236+ 'desktop ' => ".stk-- background-scheme- - $ key " ,
237+ 'desktopParentHover ' => ":where(.stk-hover-parent:hover) .stk-- background-scheme- - $ key "
236238 )
237239 );
238240 $ block_color_schemes ['container ' ][] = array (
239241 'key ' => $ key ,
240242 'mode ' => 'container ' ,
241243 'selectors ' => array (
242- 'desktop ' => ".container- $ key " ,
243- 'desktopParentHover ' => array (".container- $ key:where(:hover) " ,":where(.stk-hover-parent:hover) .container- $ key " )
244+ 'desktop ' => ".stk-- container-scheme- - $ key " ,
245+ 'desktopParentHover ' => array (".stk-- container-scheme-- $ key:where(:hover) " ,":where(.stk-hover-parent:hover) .stk-- container-scheme- - $ key " )
244246 )
245247 );
246248 }
@@ -281,13 +283,7 @@ public function add_global_color_schemes_styles( $current_css ) {
281283 * @return Array
282284 */
283285 public function convert_to_assoc_array ( $ schemes_array ) {
284- $ schemes = array ();
285-
286- foreach ( $ schemes_array as $ scheme ) {
287- $ schemes [ $ scheme ['key ' ] ] = $ scheme [ 'colorScheme ' ];
288- }
289-
290- return $ schemes ;
286+ return array_column ( $ schemes_array , 'colorScheme ' , 'key ' );
291287 }
292288
293289 /**
0 commit comments