-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
Copy pathclass-wp-nav-menu-item.php
314 lines (271 loc) · 4.89 KB
/
class-wp-nav-menu-item.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
<?php
/**
* Value object for nav menu item objects.
*
* Created to aid static analysis by PHPStan.
*
* @package WordPress
* @see wp_setup_nav_menu_item()
*/
/**
* Decorates a menu item (WP_Post) object with the shared navigation menu item properties.
*/
class WP_Nav_Menu_Item {
/**
* The term_id if the menu item represents a taxonomy term.
*
* @overrides WP_Post
* @var int
*/
public $ID;
/**
* The title attribute of the link element for this menu item.
*
* @var string
*/
public $attr_title;
/**
* The array of class attribute values for the link element of this menu item.
*
* @var array
*/
public $classes;
/**
* The DB ID of this item as a nav_menu_item object, if it exists (0 if it doesn't exist).
*
* @var int
*/
public $db_id;
/**
* The description of this menu item.
*
* @var string
*/
public $description;
/**
* The DB ID of the nav_menu_item that is this item's menu parent, if any. 0 otherwise.
*
* @var int
*/
public $menu_item_parent;
/**
* The type of object originally represented, such as "category," "post", or "attachment."
*
* @var string
*/
public $object;
/**
* The DB ID of the original object this menu item represents,
* e.g. ID for posts and term_id for categories.
*
* @var int
*/
public $object_id;
/**
* The DB ID of the original object's parent object, if any (0 otherwise).
*
* @overrides WP_Post
* @var int
*/
public $post_parent;
/**
* A "no title" label if menu item represents a post that lacks a title.
*
* @overrides WP_Post
* @var string
*/
public $post_title;
/**
* The target attribute of the link element for this menu item.
*
* @var string
*/
public $target;
/**
* The title of this menu item.
*
* @var string
*/
public $title;
/**
* The family of objects originally represented, such as "post_type" or "taxonomy."
*
* @var string
*/
public $type;
/**
* The singular label used to describe this type of menu item.
*
* @var string
*/
public $type_label;
/**
* The URL to which this menu item points.
*
* @var string
*/
public $url;
/**
* The XFN relationship expressed in the link of this menu item.
*
* @var string
*/
public $xfn;
/**
* Whether the menu item represents an object that no longer exists.
*
* @var bool
*/
public $_invalid; // phpcs:ignore PSR2.Classes.PropertyDeclaration.Underscore
/**
* Whether the menu item represents the active menu item.
*
* @var bool
*/
public $current;
/**
* Whether the menu item represents an parent menu item.
*
* @var bool
*/
public $current_item_parent;
/**
* Whether the menu item represents an ancestor menu item.
*
* @var bool
*/
public $current_item_ancestor;
/* Copy of WP_Post */
/**
* ID of post author.
*
* A numeric string, for compatibility reasons.
*
* @var string
*/
public $post_author = 0;
/**
* The post's local publication time.
*
* @var string
*/
public $post_date = '0000-00-00 00:00:00';
/**
* The post's GMT publication time.
*
* @var string
*/
public $post_date_gmt = '0000-00-00 00:00:00';
/**
* The post's content.
*
* @var string
*/
public $post_content = '';
/**
* The post's excerpt.
*
* @var string
*/
public $post_excerpt = '';
/**
* The post's status.
*
* @var string
*/
public $post_status = 'publish';
/**
* Whether comments are allowed.
*
* @var string
*/
public $comment_status = 'open';
/**
* Whether pings are allowed.
*
* @var string
*/
public $ping_status = 'open';
/**
* The post's password in plain text.
*
* @var string
*/
public $post_password = '';
/**
* The post's slug.
*
* @var string
*/
public $post_name = '';
/**
* URLs queued to be pinged.
*
* @var string
*/
public $to_ping = '';
/**
* URLs that have been pinged.
*
* @var string
*/
public $pinged = '';
/**
* The post's local modified time.
*
* @var string
*/
public $post_modified = '0000-00-00 00:00:00';
/**
* The post's GMT modified time.
*
* @var string
*/
public $post_modified_gmt = '0000-00-00 00:00:00';
/**
* A utility DB field for post content.
*
* @var string
*/
public $post_content_filtered = '';
/**
* The unique identifier for a post, not necessarily a URL, used as the feed GUID.
*
* @var string
*/
public $guid = '';
/**
* A field used for ordering posts.
*
* @var int
*/
public $menu_order = 0;
/**
* The post's type, like post or page.
*
* @var string
*/
public $post_type = 'post';
/**
* An attachment's mime type.
*
* @var string
*/
public $post_mime_type = '';
/**
* Cached comment count.
*
* A numeric string, for compatibility reasons.
*
* @var string
*/
public $comment_count = 0;
/**
* Stores the post object's sanitization level.
*
* Does not correspond to a DB field.
*
* @var string
*/
public $filter;
}