/home/techb158/public_html/wp-content/plugins/wpforms-lite/src/Admin/Blocks
NameSizeModeActions
Links.php101930666editdlrm
Edit: /home/techb158/public_html/wp-content/plugins/wpforms-lite/src/Admin/Blocks/Links.php (10193B)
'; foreach ( $links as $slug => $link ) { self::render_link( $slug, $link ); } echo '
'; } /** * Render a single link. * * @since 1.9.7 * * @param string $slug The slug for the link. * @param array $link The link data. */ private static function render_link( string $slug, array $link ): void { $url = $link['url'] ?? '#'; $text = $link['text'] ?? ''; $class = $link['class'] ?? ''; $target = $link['target'] ?? '_self'; $icon = $link['icon'] ?? ''; printf( '%6$s%5$s', esc_url( $url ), esc_attr( $target ), esc_attr( $slug ), esc_attr( $class ), esc_html( $text ), wp_kses( $icon, [ 'svg' => [ 'xmlns' => true, 'width' => true, 'height' => true, 'viewbox' => true, 'fill' => true, ], 'path' => [ 'd' => true, 'fill' => true, ], ] ) ); } /** * Get links. * * @since 1.9.7 * * @param array $utm_params UTM parameters to append to links. * * @return array */ private static function get_links( array $utm_params ): array { return [ 'docs' => [ 'url' => self::get_utm_link( 'https://wpforms.com/docs/', $utm_params['docs'] ?? [] ), 'text' => esc_html__( 'Docs', 'wpforms-lite' ), 'target' => '_blank', 'icon' => '', ], 'videos' => [ 'url' => 'https://www.youtube.com/@wpforms/videos', 'text' => esc_html__( 'Videos', 'wpforms-lite' ), 'target' => '_blank', 'icon' => '', ], 'support' => [ 'url' => wpforms()->is_pro() ? self::get_utm_link( 'https://wpforms.com/account/support/', $utm_params['support'] ?? [] ) : 'https://wordpress.org/support/plugin/wpforms-lite/', 'text' => wpforms()->is_pro() ? esc_html__( 'Support', 'wpforms-lite' ) : esc_html__( 'Support Forum', 'wpforms-lite' ), 'target' => '_blank', 'icon' => wpforms()->is_pro() ? '' : '', ], 'whats-new' => [ 'text' => esc_html__( 'What’s New', 'wpforms-lite' ), 'class' => 'wpforms-splash-modal-open', 'icon' => '', ], ]; } /** * Get UTM link. * * @since 1.9.7 * * @param string $url The URL to which UTM parameters will be added. * @param array $utm_params UTM parameters to append to the URL. * * @return string */ private static function get_utm_link( string $url, array $utm_params ): string { return wpforms_utm_link( $url, $utm_params['medium'] ?? '', $utm_params['content'] ?? '', $utm_params['term'] ?? '' ); } }