author | ymh <ymh.work@gmail.com> |
Mon, 08 Sep 2025 19:44:41 +0200 | |
changeset 23 | 417f20492bf7 |
parent 22 | 8c2e4d02f4ef |
permissions | -rw-r--r-- |
18 | 1 |
<?php |
2 |
/** |
|
3 |
* Blocks API: WP_Block_Template class |
|
4 |
* |
|
5 |
* @package WordPress |
|
6 |
* @since 5.8.0 |
|
7 |
*/ |
|
8 |
||
9 |
/** |
|
10 |
* Class representing a block template. |
|
11 |
* |
|
12 |
* @since 5.8.0 |
|
13 |
*/ |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
14 |
#[AllowDynamicProperties] |
18 | 15 |
class WP_Block_Template { |
16 |
||
17 |
/** |
|
18 |
* Type: wp_template. |
|
19 |
* |
|
20 |
* @since 5.8.0 |
|
21 |
* @var string |
|
22 |
*/ |
|
23 |
public $type; |
|
24 |
||
25 |
/** |
|
26 |
* Theme. |
|
27 |
* |
|
28 |
* @since 5.8.0 |
|
29 |
* @var string |
|
30 |
*/ |
|
31 |
public $theme; |
|
32 |
||
33 |
/** |
|
34 |
* Template slug. |
|
35 |
* |
|
36 |
* @since 5.8.0 |
|
37 |
* @var string |
|
38 |
*/ |
|
39 |
public $slug; |
|
40 |
||
41 |
/** |
|
19 | 42 |
* ID. |
18 | 43 |
* |
44 |
* @since 5.8.0 |
|
45 |
* @var string |
|
46 |
*/ |
|
47 |
public $id; |
|
48 |
||
49 |
/** |
|
50 |
* Title. |
|
51 |
* |
|
52 |
* @since 5.8.0 |
|
53 |
* @var string |
|
54 |
*/ |
|
55 |
public $title = ''; |
|
56 |
||
57 |
/** |
|
58 |
* Content. |
|
59 |
* |
|
60 |
* @since 5.8.0 |
|
61 |
* @var string |
|
62 |
*/ |
|
63 |
public $content = ''; |
|
64 |
||
65 |
/** |
|
66 |
* Description. |
|
67 |
* |
|
68 |
* @since 5.8.0 |
|
69 |
* @var string |
|
70 |
*/ |
|
71 |
public $description = ''; |
|
72 |
||
73 |
/** |
|
74 |
* Source of the content. `theme` and `custom` is used for now. |
|
75 |
* |
|
76 |
* @since 5.8.0 |
|
77 |
* @var string |
|
78 |
*/ |
|
79 |
public $source = 'theme'; |
|
80 |
||
81 |
/** |
|
19 | 82 |
* Origin of the content when the content has been customized. |
83 |
* When customized, origin takes on the value of source and source becomes |
|
84 |
* 'custom'. |
|
85 |
* |
|
86 |
* @since 5.9.0 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
87 |
* @var string|null |
19 | 88 |
*/ |
89 |
public $origin; |
|
90 |
||
91 |
/** |
|
92 |
* Post ID. |
|
18 | 93 |
* |
94 |
* @since 5.8.0 |
|
19 | 95 |
* @var int|null |
18 | 96 |
*/ |
97 |
public $wp_id; |
|
98 |
||
99 |
/** |
|
100 |
* Template Status. |
|
101 |
* |
|
102 |
* @since 5.8.0 |
|
103 |
* @var string |
|
104 |
*/ |
|
105 |
public $status; |
|
106 |
||
107 |
/** |
|
108 |
* Whether a template is, or is based upon, an existing template file. |
|
109 |
* |
|
110 |
* @since 5.8.0 |
|
19 | 111 |
* @var bool |
18 | 112 |
*/ |
113 |
public $has_theme_file; |
|
19 | 114 |
|
115 |
/** |
|
116 |
* Whether a template is a custom template. |
|
117 |
* |
|
118 |
* @since 5.9.0 |
|
119 |
* |
|
120 |
* @var bool |
|
121 |
*/ |
|
122 |
public $is_custom = true; |
|
123 |
||
124 |
/** |
|
125 |
* Author. |
|
126 |
* |
|
127 |
* A value of 0 means no author. |
|
128 |
* |
|
129 |
* @since 5.9.0 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
130 |
* @var int|null |
19 | 131 |
*/ |
132 |
public $author; |
|
133 |
||
134 |
/** |
|
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
135 |
* Plugin. |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
136 |
* |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
137 |
* @since 6.7.0 |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
138 |
* @var string|null |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
139 |
*/ |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
140 |
public $plugin; |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
141 |
|
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
142 |
/** |
19 | 143 |
* Post types. |
144 |
* |
|
145 |
* @since 5.9.0 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
146 |
* @var string[]|null |
19 | 147 |
*/ |
148 |
public $post_types; |
|
149 |
||
150 |
/** |
|
151 |
* Area. |
|
152 |
* |
|
153 |
* @since 5.9.0 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
154 |
* @var string|null |
19 | 155 |
*/ |
156 |
public $area; |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
157 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
158 |
/** |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
159 |
* Modified. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
160 |
* |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
161 |
* @since 6.3.0 |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
162 |
* @var string|null |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
163 |
*/ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
164 |
public $modified; |
18 | 165 |
} |