Added array casting (https://github.com/woocommerce/woocommerce-admin/pull/5415)
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:
parent
f1fe4211a5
commit
fbb3e8efd2
|
@ -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(
|
||||
|
|
|
@ -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,
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue