ds and + sign if value greater than zero. $form['trends'] = sprintf( '%s%s%%', $form['trends'] >= 0 ? '+' : '', $form['trends'] ); } return $input; } /** * Check if trends can be displayed for the given entries. * * @since 1.8.8 * * @param array $entries The entries data. * * @return bool */ private function entries_has_trends( array $entries ): bool { // Return false if entries array is empty. if ( empty( $entries ) ) { return false; } // Check if at least one array item has the 'trends' key. foreach ( $entries as $entry ) { if ( isset( $entry['trends'] ) ) { return true; } } return false; } /** * Get icons URL. * Primarily used in the HTML version of the email template. * * @since 1.8.8 * * @return array */ private function get_icons_url(): array { $base_url = WPFORMS_PLUGIN_URL . 'assets/images/email/'; return [ 'overview' => $base_url . 'icon-overview.png', 'upward' => $base_url . 'icon-upward.png', 'downward' => $base_url . 'icon-downward.png', 'notification_block' => $base_url . 'notification-block-icon.png', 'info_block' => $base_url . 'info-block-icon.png', ]; } }