Fix saving the block config

This commit is contained in:
Narek Zakarian 2024-04-02 15:09:52 +04:00
parent 012c7281f7
commit 155677934a
No known key found for this signature in database
GPG key ID: 07AFD7E7A9C164A7

View file

@ -99,10 +99,13 @@ class SaveConfig {
$this->settings->set( 'pay_later_messaging_enabled', true );
$enabled_locations = array();
foreach ( $config as $placement => $data ) {
$this->save_config_for_location( $data, $placement );
if ( $placement === 'custom_placement' ) {
$data = $data[0] ?? array();
}
if ( $data['status'] === 'enabled' ) {
$enabled_locations[] = $placement;
}