class-qdr-tss-shortcode.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. /**
  3. * Shortcode functionality of the plugin.
  4. *
  5. * @package QDR_Temporary_Shared_Storage
  6. * @since 1.0.0
  7. */
  8. class QDR_TSS_Shortcode {
  9. /**
  10. * The ID of this plugin.
  11. *
  12. * @since 1.0.0
  13. * @access private
  14. * @var string $plugin_name The ID of this plugin.
  15. */
  16. private $plugin_name;
  17. /**
  18. * The version of this plugin.
  19. *
  20. * @since 1.0.0
  21. * @access private
  22. * @var string $version The current version of this plugin.
  23. */
  24. private $version;
  25. /**
  26. * The download handler instance.
  27. *
  28. * @since 1.0.0
  29. * @access private
  30. * @var QDR_TSS_Download $download The download handler instance.
  31. */
  32. private $download;
  33. /**
  34. * Initialize the class and set its properties.
  35. *
  36. * @since 1.0.0
  37. * @param string $plugin_name The name of this plugin.
  38. * @param string $version The version of this plugin.
  39. */
  40. public function __construct($plugin_name, $version) {
  41. $this->plugin_name = $plugin_name;
  42. $this->version = $version;
  43. $this->download = new QDR_TSS_Download($plugin_name, $version);
  44. }
  45. /**
  46. * Register shortcodes.
  47. *
  48. * @since 1.0.0
  49. */
  50. public function register_shortcodes() {
  51. add_shortcode('qdr_tss_download', array($this, 'download_shortcode'));
  52. }
  53. /**
  54. * Download shortcode.
  55. *
  56. * @since 1.0.0
  57. * @param array $atts Shortcode attributes.
  58. * @return string Shortcode output.
  59. */
  60. public function download_shortcode($atts) {
  61. return $this->download->process_download_request($atts);
  62. }
  63. }