urn count( $products['remaining'] ) === 0; } /** * Dismissable. * * @return bool */ public function is_dismissable() { return true; } /** * Task visibility. * * @return bool */ public function can_view() { $products = $this->get_paid_products_and_themes(); return count( $products['purchaseable'] ) > 0; } /** * Get purchaseable and remaining products. * * @return array purchaseable and remaining products and themes. */ public static function get_paid_products_and_themes() { $relevant_products = OnboardingProducts::get_relevant_products(); $profiler_data = get_option( OnboardingProfile::DATA_OPTION, array() ); $theme = isset( $profiler_data['theme'] ) ? $profiler_data['theme'] : null; $paid_theme = $theme ? OnboardingThemes::get_paid_theme_by_slug( $theme ) : null; if ( $paid_theme ) { $relevant_products['purchaseable'][] = $paid_theme; if ( isset( $paid_theme['is_installed'] ) && false === $paid_theme['is_installed'] ) { $relevant_products['remaining'][] = $paid_theme['title']; } } return $relevant_products; } }