Automattic\WooCommerce\Admin\API

OnboardingProfile::get_profile_propertiespublic staticWC 1.0

Get onboarding profile properties.

Method of the class: OnboardingProfile{}

Returns

Array.

Usage

$result = OnboardingProfile::get_profile_properties();

OnboardingProfile::get_profile_properties() code WC 9.9.4

public static function get_profile_properties() {
	$properties = array(
		'completed'               => array(
			'type'              => 'boolean',
			'description'       => __( 'Whether or not the profile was completed.', 'woocommerce' ),
			'context'           => array( 'view' ),
			'readonly'          => true,
			'validate_callback' => 'rest_validate_request_arg',
		),
		'skipped'                 => array(
			'type'              => 'boolean',
			'description'       => __( 'Whether or not the profile was skipped.', 'woocommerce' ),
			'context'           => array( 'view' ),
			'readonly'          => true,
			'validate_callback' => 'rest_validate_request_arg',
		),
		'industry'                => array(
			'type'              => 'array',
			'description'       => __( 'Industry.', 'woocommerce' ),
			'context'           => array( 'view' ),
			'readonly'          => true,
			'nullable'          => true,
			'validate_callback' => 'rest_validate_request_arg',
			'items'             => array(
				'type' => 'string',
			),
		),
		'business_extensions'     => array(
			'type'              => 'array',
			'description'       => __( 'Extra business extensions to install.', 'woocommerce' ),
			'context'           => array( 'view' ),
			'readonly'          => true,
			'sanitize_callback' => 'wp_parse_slug_list',
			'validate_callback' => 'rest_validate_request_arg',
			'items'             => array(
				'type' => 'string',
			),
		),
		'is_agree_marketing'      => array(
			'type'              => 'boolean',
			'description'       => __( 'Whether or not this store agreed to receiving marketing contents from WooCommerce.com.', 'woocommerce' ),
			'context'           => array( 'view' ),
			'readonly'          => true,
			'validate_callback' => 'rest_validate_request_arg',
		),
		'store_email'             => array(
			'type'              => 'string',
			'description'       => __( 'Store email address.', 'woocommerce' ),
			'context'           => array( 'view' ),
			'readonly'          => true,
			'nullable'          => true,
			'validate_callback' => array( __CLASS__, 'rest_validate_marketing_email' ),
		),
		'is_store_country_set'    => array(
			'type'              => 'boolean',
			'description'       => __( 'Whether or not this store country is set via onboarding profiler.', 'woocommerce' ),
			'context'           => array( 'view' ),
			'readonly'          => true,
			'validate_callback' => 'rest_validate_request_arg',
		),
		'is_plugins_page_skipped' => array(
			'type'              => 'boolean',
			'description'       => __( 'Whether or not plugins step in core profiler was skipped.', 'woocommerce' ),
			'context'           => array( 'view' ),
			'readonly'          => true,
			'validate_callback' => 'rest_validate_request_arg',
		),
		'business_choice'         => array(
			'type'        => 'string',
			'description' => __( 'Business choice.', 'woocommerce' ),
			'context'     => array( 'view' ),
			'readonly'    => true,
			'nullable'    => true,
		),
		'selling_online_answer'   => array(
			'type'        => 'string',
			'description' => __( 'Selling online answer.', 'woocommerce' ),
			'context'     => array( 'view' ),
			'readonly'    => true,
			'nullable'    => true,
		),
		'selling_platforms'       => array(
			'type'        => array( 'array', 'null' ),
			'description' => __( 'Selling platforms.', 'woocommerce' ),
			'context'     => array( 'view' ),
			'readonly'    => true,
			'nullable'    => true,
			'items'       => array(
				'type' => array( 'string', 'null' ),
			),
		),
	);

	/**
	 * Filters the Onboarding Profile REST API JSON Schema.
	 *
	 * @since 6.5.0
	 * @param array $properties List of properties.
	 */
	return apply_filters( 'woocommerce_rest_onboarding_profile_properties', $properties );
}