Check before merging arrays
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
* @author ThemeBoy
|
* @author ThemeBoy
|
||||||
* @category Admin
|
* @category Admin
|
||||||
* @package SportsPress/Admin
|
* @package SportsPress/Admin
|
||||||
* @version 1.8.4
|
* @version 1.8.5
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||||
@@ -215,9 +215,12 @@ class SP_Settings_General extends SP_Settings_Page {
|
|||||||
'link' => $link,
|
'link' => $link,
|
||||||
);
|
);
|
||||||
|
|
||||||
$options = (array) get_option( 'themeboy', array() );
|
$options = get_option( 'themeboy', array() );
|
||||||
$options = array_merge( $options, $colors );
|
if ( is_array( $options ) ) {
|
||||||
update_option( 'themeboy', $options );
|
$colors = array_merge( $options, $colors );
|
||||||
|
}
|
||||||
|
|
||||||
|
update_option( 'themeboy', $colors );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user