@@ -16,12 +16,27 @@ function log_list( $list ) {
1616}
1717}
1818
19- function kebab_case_to_snake_case ($ value ) {
19+ function kebab_case_to_snake_case ($ value ) {
2020return preg_replace_callback ('/-(.)/u ' ,function ($ el ) {
2121return '_ ' .$ el [1 ];
2222},$ value );
2323}
2424
25+ function values_as_booleans_to_one_and_zero_strings ($ array ) {
26+ $ result = [];
27+
28+ foreach ($ arrayas $ key =>$ value ) {
29+ if ($ value ==='true ' ||$ value ==='false ' ) {
30+ $ result [$ key ] = (string )(int )($ value ==='true ' );
31+ continue ;
32+ }
33+
34+ $ result [$ key ] =$ value ;
35+ }
36+
37+ return $ result ;
38+ }
39+
2540function keys_from_kebab_case_to_snake_case ($ array ) {
2641$ result = [];
2742
@@ -89,7 +104,9 @@ function cli_create_profile( $name, $assoc_args ) {
89104$ new_profile ["save_migration_profile " ] ="1 " ;
90105$ new_profile ["save_migration_profile_option " ] ="new " ;
91106
92- $ new_profile =array_merge ($ new_profile ,$ this ->keys_from_kebab_case_to_snake_case ($ assoc_args ) );
107+ $ values_for_wordpress =$ this ->keys_from_kebab_case_to_snake_case ($ assoc_args );
108+ $ values_for_wordpress =$ this ->values_as_booleans_to_one_and_zero_strings ($ values_for_wordpress );
109+ $ new_profile =array_merge ($ new_profile ,$ values_for_wordpress );
93110
94111if (isset ($ assoc_args ['exclude-post-types ' ] ) ) {
95112$ new_profile ['exclude_post_types ' ] ='1 ' ;
@@ -128,7 +145,6 @@ function cli_create_profile( $name, $assoc_args ) {
128145}
129146
130147$ wpsdb_settings ['profiles ' ][] =$ new_profile ;
131-
132148update_option ('wpsdb_settings ' ,$ wpsdb_settings );
133149
134150return true ;