This commit adds an array casting after getting "woocommerce_onboarding_profile" option.

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
This commit is contained in:
Fernando 2020-10-16 12:47:09 -03:00 committed by GitHub
parent f1fe4211a5
commit fbb3e8efd2
2 changed files with 2 additions and 2 deletions

View File

@ -138,7 +138,7 @@ class OnboardingProfile extends \WC_REST_Data_Controller {
public function update_items( $request ) {
$params = $request->get_json_params();
$query_args = $this->prepare_objects_query( $params );
$onboarding_data = get_option( Onboarding::PROFILE_DATA_OPTION, array() );
$onboarding_data = (array) get_option( Onboarding::PROFILE_DATA_OPTION, array() );
update_option( Onboarding::PROFILE_DATA_OPTION, array_merge( $onboarding_data, $query_args ) );
$result = array(

View File

@ -656,7 +656,7 @@ class Onboarding {
* @param array $settings Component settings.
*/
public function component_settings( $settings ) {
$profile = get_option( self::PROFILE_DATA_OPTION, array() );
$profile = (array) get_option( self::PROFILE_DATA_OPTION, array() );
$settings['onboarding'] = array(
'profile' => $profile,
);