Automattic\WooCommerce\Admin\Features
Onboarding::should_show_profiler() public WC 1.0
Returns true if the profiler should be displayed (not completed and not skipped).
{} Это метод класса: Onboarding{}
Хуков нет.
Возвращает
true|false
. Ничего.
Использование
$result = Onboarding::should_show_profiler();
Код Onboarding::should_show_profiler() Onboarding::should show profiler WC 5.2.2
public static function should_show_profiler() {
/* phpcs:disable WordPress.Security.NonceVerification */
$is_current_page = isset( $_GET['page'] ) &&
'wc-admin' === $_GET['page'] &&
isset( $_GET['path'] ) &&
'/setup-wizard' === $_GET['path'];
/* phpcs: enable */
if ( $is_current_page ) {
return true;
}
$onboarding_data = get_option( self::PROFILE_DATA_OPTION, array() );
$is_completed = isset( $onboarding_data['completed'] ) && true === $onboarding_data['completed'];
$is_skipped = isset( $onboarding_data['skipped'] ) && true === $onboarding_data['skipped'];
// @todo When merging to WooCommerce Core, we should set the `completed` flag to true during the upgrade progress.
// https://github.com/woocommerce/woocommerce-admin/pull/2300#discussion_r287237498.
return ! $is_completed && ! $is_skipped;
}