Нет описания

templates-item.php 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. /**
  3. * Panel Setup (form templates).
  4. * Form templates list item template.
  5. *
  6. * @since 1.6.8
  7. *
  8. * @var string $selected_class Selected item class.
  9. * @var string $license_class License class (in the case of higher license needed).
  10. * @var string $categories Categories, coma separated.
  11. * @var string $badge_text Badge text.
  12. * @var string $demo_url Template demo URL.
  13. * @var string $template_id Template ID (Slug or ID if available).
  14. * @var string $education_class Education class (in the case of higher license needed).
  15. * @var string $education_attributes Education attributes.
  16. * @var string $addons_attributes Required addons attributes.
  17. * @var array $template Template data.
  18. */
  19. if ( ! defined( 'ABSPATH' ) ) {
  20. exit;
  21. }
  22. ?>
  23. <div class="wpforms-template<?php echo esc_attr( $selected_class ); ?><?php echo esc_attr( $license_class ); ?>"
  24. id="wpforms-template-<?php echo sanitize_html_class( $template['slug'] ); ?>">
  25. <h3 class="wpforms-template-name categories" data-categories="<?php echo esc_attr( $categories ); ?>">
  26. <?php echo esc_html( $template['name'] ); ?>
  27. </h3>
  28. <?php if ( ! empty( $badge_text ) ) { ?>
  29. <span class="wpforms-template-badge"><?php echo esc_html( $badge_text ); ?></span>
  30. <?php } ?>
  31. <?php if ( ! empty( $template['description'] ) ) : ?>
  32. <p class="wpforms-template-desc"><?php echo esc_html( $template['description'] ); ?></p>
  33. <?php endif; ?>
  34. <div class="wpforms-template-buttons">
  35. <a href="#" class="wpforms-template-select wpforms-btn wpforms-btn-md wpforms-btn-orange<?php echo esc_attr( $education_class ); ?>"
  36. data-template-name-raw="<?php echo esc_attr( $template['name'] ); ?>"
  37. data-template="<?php echo esc_attr( $template_id ); ?>"
  38. data-slug="<?php echo esc_attr( $template['slug'] ); ?>"
  39. <?php echo $education_attributes; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
  40. <?php echo $addons_attributes; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
  41. <?php
  42. $template['slug'] !== 'blank'
  43. ? esc_html_e( 'Use Template', 'wpforms-lite' )
  44. : esc_html_e( 'Create Blank Form', 'wpforms-lite' );
  45. ?>
  46. </a>
  47. <?php if ( $template['url'] !== '' ) : ?>
  48. <a class="wpforms-template-demo wpforms-btn wpforms-btn-md wpforms-btn-light-grey"
  49. href="<?php echo esc_url( $demo_url ); ?>"
  50. target="_blank" rel="noopener noreferrer">
  51. <?php esc_html_e( 'View Demo', 'wpforms-lite' ); ?>
  52. </a>
  53. <?php endif; ?>
  54. </div>
  55. </div>