Automattic\WooCommerce\Admin\Features\OnboardingTasks

TaskLists::setup_tasks_remaining()public staticWC 1.0

Return number of setup tasks remaining

Метод класса: TaskLists{}

Хуков нет.

Возвращает

number.

Использование

$result = TaskLists::setup_tasks_remaining();

Код TaskLists::setup_tasks_remaining() WC 7.3.0

public static function setup_tasks_remaining() {
	$setup_list = self::get_list( 'setup' );

	if ( ! $setup_list || $setup_list->is_hidden() || $setup_list->is_complete() ) {
		return;
	}

	$remaining_tasks = array_values(
		array_filter(
			$setup_list->get_viewable_tasks(),
			function( $task ) {
				return ! $task->is_complete();
			}
		)
	);

	return count( $remaining_tasks );
}