class-wp-block-template.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. <?php
  2. /**
  3. * Blocks API: WP_Block_Template class
  4. *
  5. * @package WordPress
  6. * @since 5.8.0
  7. */
  8. /**
  9. * Class representing a block template.
  10. *
  11. * @since 5.8.0
  12. */
  13. #[AllowDynamicProperties]
  14. class WP_Block_Template {
  15. /**
  16. * Type: wp_template.
  17. *
  18. * @since 5.8.0
  19. * @var string
  20. */
  21. public $type;
  22. /**
  23. * Theme.
  24. *
  25. * @since 5.8.0
  26. * @var string
  27. */
  28. public $theme;
  29. /**
  30. * Template slug.
  31. *
  32. * @since 5.8.0
  33. * @var string
  34. */
  35. public $slug;
  36. /**
  37. * ID.
  38. *
  39. * @since 5.8.0
  40. * @var string
  41. */
  42. public $id;
  43. /**
  44. * Title.
  45. *
  46. * @since 5.8.0
  47. * @var string
  48. */
  49. public $title = '';
  50. /**
  51. * Content.
  52. *
  53. * @since 5.8.0
  54. * @var string
  55. */
  56. public $content = '';
  57. /**
  58. * Description.
  59. *
  60. * @since 5.8.0
  61. * @var string
  62. */
  63. public $description = '';
  64. /**
  65. * Source of the content. `theme` and `custom` is used for now.
  66. *
  67. * @since 5.8.0
  68. * @var string
  69. */
  70. public $source = 'theme';
  71. /**
  72. * Origin of the content when the content has been customized.
  73. * When customized, origin takes on the value of source and source becomes
  74. * 'custom'.
  75. *
  76. * @since 5.9.0
  77. * @var string
  78. */
  79. public $origin;
  80. /**
  81. * Post ID.
  82. *
  83. * @since 5.8.0
  84. * @var int|null
  85. */
  86. public $wp_id;
  87. /**
  88. * Template Status.
  89. *
  90. * @since 5.8.0
  91. * @var string
  92. */
  93. public $status;
  94. /**
  95. * Whether a template is, or is based upon, an existing template file.
  96. *
  97. * @since 5.8.0
  98. * @var bool
  99. */
  100. public $has_theme_file;
  101. /**
  102. * Whether a template is a custom template.
  103. *
  104. * @since 5.9.0
  105. *
  106. * @var bool
  107. */
  108. public $is_custom = true;
  109. /**
  110. * Author.
  111. *
  112. * A value of 0 means no author.
  113. *
  114. * @since 5.9.0
  115. * @var int
  116. */
  117. public $author;
  118. /**
  119. * Post types.
  120. *
  121. * @since 5.9.0
  122. * @var array
  123. */
  124. public $post_types;
  125. /**
  126. * Area.
  127. *
  128. * @since 5.9.0
  129. * @var string
  130. */
  131. public $area;
  132. }