class-wpseo-replacement-variable.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. /**
  3. * WPSEO plugin file.
  4. *
  5. * @package WPSEO\Internals
  6. * @since 7.7
  7. */
  8. /**
  9. * Class WPSEO_Replacement_Variable.
  10. *
  11. * This class stores the data of a single snippet variable.
  12. */
  13. class WPSEO_Replacement_Variable {
  14. /**
  15. * The variable to use.
  16. *
  17. * @var string
  18. */
  19. protected $variable;
  20. /**
  21. * The label of the replacement variable.
  22. *
  23. * @var string
  24. */
  25. protected $label;
  26. /**
  27. * The description of the replacement variable.
  28. *
  29. * @var string
  30. */
  31. protected $description;
  32. /**
  33. * WPSEO_Replacement_Variable constructor.
  34. *
  35. * @param string $variable The variable that is replaced.
  36. * @param string $label The label of the replacement variable.
  37. * @param string $description The description of the replacement variable.
  38. *
  39. * @return \WPSEO_Replacement_Variable
  40. */
  41. public function __construct( $variable, $label, $description ) {
  42. $this->variable = $variable;
  43. $this->label = $label;
  44. $this->description = $description;
  45. }
  46. /**
  47. * Returns the variable to use.
  48. *
  49. * @return string
  50. */
  51. public function get_variable() {
  52. return $this->variable;
  53. }
  54. /**
  55. * Returns the label of the replacement variable.
  56. *
  57. * @return string
  58. */
  59. public function get_label() {
  60. return $this->label;
  61. }
  62. /**
  63. * Returns the description of the replacement variable.
  64. *
  65. * @return string
  66. */
  67. public function get_description() {
  68. return $this->description;
  69. }
  70. }