File tree Expand file tree Collapse file tree 2 files changed +15
-9
lines changed
Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -13,15 +13,21 @@ class BFIE_Activator{
1313
1414 public static function activate () {
1515
16- $ settings = array (
17- 'general ' => array (
18- 'bfi_per_page ' => BFIE_PER_PAGE ,
19- 'bfi_posttyps ' => array ( 'post ' , 'page ' ),
20- 'enable_default_image ' => array ( 'post ' , 'page ' ),
21- ),
22- );
23-
24- update_option ( 'bfi_settings ' , $ settings );
16+ $ setting_key = 'bfi_settings ' ;
17+ $ bfi_settings = get_option ( $ setting_key );
18+ $ bfi_settings = !empty ( $ bfi_settings ) ? $ bfi_settings : array ();
19+
20+ if ( empty ( $ bfi_settings ) ) {
21+ $ settings = array (
22+ 'general ' => array (
23+ 'bfi_per_page ' => BFIE_PER_PAGE ,
24+ 'bfi_posttyps ' => array ('post ' , 'page ' ),
25+ 'enable_default_image ' => array ('post ' , 'page ' ),
26+ ),
27+ );
28+
29+ update_option ('bfi_settings ' , $ settings );
30+ }
2531
2632 set_transient ( '_bfie_activation_redirect ' , true , 30 );
2733 }
File renamed without changes.
You can’t perform that action at this time.
0 commit comments