class-wpseo-replacement-variable.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. * @var string The variable to use.
  16. */
  17. protected $variable;
  18. /**
  19. * @var string The label of the replacement variable.
  20. */
  21. protected $label;
  22. /**
  23. * @var string The description of the replacement variable.
  24. */
  25. protected $description;
  26. /**
  27. * WPSEO_Replacement_Variable constructor.
  28. *
  29. * @param string $variable The variable that is replaced.
  30. * @param string $label The label of the replacement variable.
  31. * @param string $description The description of the replacement variable.
  32. *
  33. * @return \WPSEO_Replacement_Variable
  34. */
  35. public function __construct( $variable, $label, $description ) {
  36. $this->variable = $variable;
  37. $this->label = $label;
  38. $this->description = $description;
  39. }
  40. /**
  41. * Returns the variable to use.
  42. *
  43. * @return string
  44. */
  45. public function get_variable() {
  46. return $this->variable;
  47. }
  48. /**
  49. * Returns the label of the replacement variable.
  50. *
  51. * @return string
  52. */
  53. public function get_label() {
  54. return $this->label;
  55. }
  56. /**
  57. * Returns the description of the replacement variable.
  58. *
  59. * @return string
  60. */
  61. public function get_description() {
  62. return $this->description;
  63. }
  64. }