author | ymh <ymh.work@gmail.com> |
Mon, 08 Sep 2025 19:44:41 +0200 | |
changeset 23 | 417f20492bf7 |
parent 22 | 8c2e4d02f4ef |
permissions | -rw-r--r-- |
0 | 1 |
<?php |
16 | 2 |
/** |
3 |
* WordPress Administration Meta Boxes API. |
|
4 |
* |
|
5 |
* @package WordPress |
|
6 |
* @subpackage Administration |
|
7 |
*/ |
|
0 | 8 |
|
16 | 9 |
// |
10 |
// Post-related Meta Boxes. |
|
11 |
// |
|
0 | 12 |
|
13 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
14 |
* Displays post submit form fields. |
0 | 15 |
* |
16 |
* @since 2.7.0 |
|
17 |
* |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
18 |
* @global string $action |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
19 |
* |
16 | 20 |
* @param WP_Post $post Current post object. |
21 |
* @param array $args { |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
22 |
* Array of arguments for building the post submit meta box. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
23 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
24 |
* @type string $id Meta box 'id' attribute. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
25 |
* @type string $title Meta box title. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
26 |
* @type callable $callback Meta box display callback. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
27 |
* @type array $args Extra meta box arguments. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
28 |
* } |
0 | 29 |
*/ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
30 |
function post_submit_meta_box( $post, $args = array() ) { |
0 | 31 |
global $action; |
32 |
||
16 | 33 |
$post_id = (int) $post->ID; |
9 | 34 |
$post_type = $post->post_type; |
35 |
$post_type_object = get_post_type_object( $post_type ); |
|
36 |
$can_publish = current_user_can( $post_type_object->cap->publish_posts ); |
|
37 |
?> |
|
0 | 38 |
<div class="submitbox" id="submitpost"> |
39 |
||
40 |
<div id="minor-publishing"> |
|
41 |
||
16 | 42 |
<?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key. ?> |
43 |
<div style="display:none;"> |
|
44 |
<?php submit_button( __( 'Save' ), '', 'save' ); ?> |
|
45 |
</div> |
|
46 |
||
47 |
<div id="minor-publishing-actions"> |
|
48 |
<div id="save-action"> |
|
49 |
<?php |
|
50 |
if ( ! in_array( $post->post_status, array( 'publish', 'future', 'pending' ), true ) ) { |
|
51 |
$private_style = ''; |
|
52 |
if ( 'private' === $post->post_status ) { |
|
53 |
$private_style = 'style="display:none"'; |
|
54 |
} |
|
55 |
?> |
|
56 |
<input <?php echo $private_style; ?> type="submit" name="save" id="save-post" value="<?php esc_attr_e( 'Save Draft' ); ?>" class="button" /> |
|
57 |
<span class="spinner"></span> |
|
58 |
<?php } elseif ( 'pending' === $post->post_status && $can_publish ) { ?> |
|
59 |
<input type="submit" name="save" id="save-post" value="<?php esc_attr_e( 'Save as Pending' ); ?>" class="button" /> |
|
60 |
<span class="spinner"></span> |
|
61 |
<?php } ?> |
|
62 |
</div> |
|
0 | 63 |
|
9 | 64 |
<?php |
16 | 65 |
if ( is_post_type_viewable( $post_type_object ) ) : |
66 |
?> |
|
67 |
<div id="preview-action"> |
|
68 |
<?php |
|
69 |
$preview_link = esc_url( get_preview_post_link( $post ) ); |
|
70 |
if ( 'publish' === $post->post_status ) { |
|
71 |
$preview_button_text = __( 'Preview Changes' ); |
|
72 |
} else { |
|
73 |
$preview_button_text = __( 'Preview' ); |
|
74 |
} |
|
5 | 75 |
|
16 | 76 |
$preview_button = sprintf( |
77 |
'%1$s<span class="screen-reader-text"> %2$s</span>', |
|
78 |
$preview_button_text, |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
79 |
/* translators: Hidden accessibility text. */ |
16 | 80 |
__( '(opens in a new tab)' ) |
81 |
); |
|
82 |
?> |
|
83 |
<a class="preview button" href="<?php echo $preview_link; ?>" target="wp-preview-<?php echo $post_id; ?>" id="post-preview"><?php echo $preview_button; ?></a> |
|
84 |
<input type="hidden" name="wp-preview" id="wp-preview" value="" /> |
|
85 |
</div> |
|
86 |
<?php |
|
87 |
endif; |
|
88 |
||
89 |
/** |
|
19 | 90 |
* Fires after the Save Draft (or Save as Pending) and Preview (or Preview Changes) buttons |
91 |
* in the Publish meta box. |
|
16 | 92 |
* |
93 |
* @since 4.4.0 |
|
94 |
* |
|
95 |
* @param WP_Post $post WP_Post object for the current post. |
|
96 |
*/ |
|
97 |
do_action( 'post_submitbox_minor_actions', $post ); |
|
9 | 98 |
?> |
16 | 99 |
<div class="clear"></div> |
100 |
</div> |
|
0 | 101 |
|
16 | 102 |
<div id="misc-publishing-actions"> |
103 |
<div class="misc-pub-section misc-pub-post-status"> |
|
104 |
<?php _e( 'Status:' ); ?> |
|
105 |
<span id="post-status-display"> |
|
106 |
<?php |
|
107 |
switch ( $post->post_status ) { |
|
108 |
case 'private': |
|
109 |
_e( 'Privately Published' ); |
|
110 |
break; |
|
111 |
case 'publish': |
|
112 |
_e( 'Published' ); |
|
113 |
break; |
|
114 |
case 'future': |
|
115 |
_e( 'Scheduled' ); |
|
116 |
break; |
|
117 |
case 'pending': |
|
118 |
_e( 'Pending Review' ); |
|
119 |
break; |
|
120 |
case 'draft': |
|
121 |
case 'auto-draft': |
|
122 |
_e( 'Draft' ); |
|
123 |
break; |
|
124 |
} |
|
125 |
?> |
|
126 |
</span> |
|
0 | 127 |
|
9 | 128 |
<?php |
16 | 129 |
if ( 'publish' === $post->post_status || 'private' === $post->post_status || $can_publish ) { |
130 |
$private_style = ''; |
|
131 |
if ( 'private' === $post->post_status ) { |
|
132 |
$private_style = 'style="display:none"'; |
|
133 |
} |
|
134 |
?> |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
135 |
<a href="#post_status" <?php echo $private_style; ?> class="edit-post-status hide-if-no-js" role="button"><span aria-hidden="true"><?php _e( 'Edit' ); ?></span> <span class="screen-reader-text"> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
136 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
137 |
/* translators: Hidden accessibility text. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
138 |
_e( 'Edit status' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
139 |
?> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
140 |
</span></a> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
141 |
|
16 | 142 |
<div id="post-status-select" class="hide-if-js"> |
143 |
<input type="hidden" name="hidden_post_status" id="hidden_post_status" value="<?php echo esc_attr( ( 'auto-draft' === $post->post_status ) ? 'draft' : $post->post_status ); ?>" /> |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
144 |
<label for="post_status" class="screen-reader-text"> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
145 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
146 |
/* translators: Hidden accessibility text. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
147 |
_e( 'Set status' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
148 |
?> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
149 |
</label> |
16 | 150 |
<select name="post_status" id="post_status"> |
151 |
<?php if ( 'publish' === $post->post_status ) : ?> |
|
152 |
<option<?php selected( $post->post_status, 'publish' ); ?> value='publish'><?php _e( 'Published' ); ?></option> |
|
153 |
<?php elseif ( 'private' === $post->post_status ) : ?> |
|
154 |
<option<?php selected( $post->post_status, 'private' ); ?> value='publish'><?php _e( 'Privately Published' ); ?></option> |
|
155 |
<?php elseif ( 'future' === $post->post_status ) : ?> |
|
156 |
<option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e( 'Scheduled' ); ?></option> |
|
157 |
<?php endif; ?> |
|
158 |
<option<?php selected( $post->post_status, 'pending' ); ?> value='pending'><?php _e( 'Pending Review' ); ?></option> |
|
159 |
<?php if ( 'auto-draft' === $post->post_status ) : ?> |
|
160 |
<option<?php selected( $post->post_status, 'auto-draft' ); ?> value='draft'><?php _e( 'Draft' ); ?></option> |
|
161 |
<?php else : ?> |
|
162 |
<option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e( 'Draft' ); ?></option> |
|
163 |
<?php endif; ?> |
|
164 |
</select> |
|
165 |
<a href="#post_status" class="save-post-status hide-if-no-js button"><?php _e( 'OK' ); ?></a> |
|
166 |
<a href="#post_status" class="cancel-post-status hide-if-no-js button-cancel"><?php _e( 'Cancel' ); ?></a> |
|
167 |
</div> |
|
168 |
<?php |
|
9 | 169 |
} |
170 |
?> |
|
16 | 171 |
</div> |
0 | 172 |
|
16 | 173 |
<div class="misc-pub-section misc-pub-visibility" id="visibility"> |
174 |
<?php _e( 'Visibility:' ); ?> |
|
175 |
<span id="post-visibility-display"> |
|
176 |
<?php |
|
177 |
if ( 'private' === $post->post_status ) { |
|
178 |
$post->post_password = ''; |
|
179 |
$visibility = 'private'; |
|
180 |
$visibility_trans = __( 'Private' ); |
|
181 |
} elseif ( ! empty( $post->post_password ) ) { |
|
182 |
$visibility = 'password'; |
|
183 |
$visibility_trans = __( 'Password protected' ); |
|
184 |
} elseif ( 'post' === $post_type && is_sticky( $post_id ) ) { |
|
185 |
$visibility = 'public'; |
|
186 |
$visibility_trans = __( 'Public, Sticky' ); |
|
187 |
} else { |
|
188 |
$visibility = 'public'; |
|
189 |
$visibility_trans = __( 'Public' ); |
|
190 |
} |
|
0 | 191 |
|
16 | 192 |
echo esc_html( $visibility_trans ); |
193 |
?> |
|
194 |
</span> |
|
0 | 195 |
|
16 | 196 |
<?php if ( $can_publish ) { ?> |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
197 |
<a href="#visibility" class="edit-visibility hide-if-no-js" role="button"><span aria-hidden="true"><?php _e( 'Edit' ); ?></span> <span class="screen-reader-text"> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
198 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
199 |
/* translators: Hidden accessibility text. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
200 |
_e( 'Edit visibility' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
201 |
?> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
202 |
</span></a> |
0 | 203 |
|
16 | 204 |
<div id="post-visibility-select" class="hide-if-js"> |
205 |
<input type="hidden" name="hidden_post_password" id="hidden-post-password" value="<?php echo esc_attr( $post->post_password ); ?>" /> |
|
206 |
<?php if ( 'post' === $post_type ) : ?> |
|
207 |
<input type="checkbox" style="display:none" name="hidden_post_sticky" id="hidden-post-sticky" value="sticky" <?php checked( is_sticky( $post_id ) ); ?> /> |
|
208 |
<?php endif; ?> |
|
0 | 209 |
|
16 | 210 |
<input type="hidden" name="hidden_post_visibility" id="hidden-post-visibility" value="<?php echo esc_attr( $visibility ); ?>" /> |
211 |
<input type="radio" name="visibility" id="visibility-radio-public" value="public" <?php checked( $visibility, 'public' ); ?> /> <label for="visibility-radio-public" class="selectit"><?php _e( 'Public' ); ?></label><br /> |
|
212 |
||
213 |
<?php if ( 'post' === $post_type && current_user_can( 'edit_others_posts' ) ) : ?> |
|
214 |
<span id="sticky-span"><input id="sticky" name="sticky" type="checkbox" value="sticky" <?php checked( is_sticky( $post_id ) ); ?> /> <label for="sticky" class="selectit"><?php _e( 'Stick this post to the front page' ); ?></label><br /></span> |
|
215 |
<?php endif; ?> |
|
216 |
||
217 |
<input type="radio" name="visibility" id="visibility-radio-password" value="password" <?php checked( $visibility, 'password' ); ?> /> <label for="visibility-radio-password" class="selectit"><?php _e( 'Password protected' ); ?></label><br /> |
|
218 |
<span id="password-span"><label for="post_password"><?php _e( 'Password:' ); ?></label> <input type="text" name="post_password" id="post_password" value="<?php echo esc_attr( $post->post_password ); ?>" maxlength="255" /><br /></span> |
|
0 | 219 |
|
16 | 220 |
<input type="radio" name="visibility" id="visibility-radio-private" value="private" <?php checked( $visibility, 'private' ); ?> /> <label for="visibility-radio-private" class="selectit"><?php _e( 'Private' ); ?></label><br /> |
0 | 221 |
|
16 | 222 |
<p> |
223 |
<a href="#visibility" class="save-post-visibility hide-if-no-js button"><?php _e( 'OK' ); ?></a> |
|
224 |
<a href="#visibility" class="cancel-post-visibility hide-if-no-js button-cancel"><?php _e( 'Cancel' ); ?></a> |
|
225 |
</p> |
|
226 |
</div> |
|
227 |
<?php } ?> |
|
228 |
</div> |
|
0 | 229 |
|
16 | 230 |
<?php |
18 | 231 |
/* translators: Publish box date string. 1: Date, 2: Time. See https://www.php.net/manual/datetime.format.php */ |
16 | 232 |
$date_string = __( '%1$s at %2$s' ); |
18 | 233 |
/* translators: Publish box date format, see https://www.php.net/manual/datetime.format.php */ |
16 | 234 |
$date_format = _x( 'M j, Y', 'publish box date format' ); |
18 | 235 |
/* translators: Publish box time format, see https://www.php.net/manual/datetime.format.php */ |
16 | 236 |
$time_format = _x( 'H:i', 'publish box time format' ); |
0 | 237 |
|
16 | 238 |
if ( 0 !== $post_id ) { |
239 |
if ( 'future' === $post->post_status ) { // Scheduled for publishing at a future date. |
|
240 |
/* translators: Post date information. %s: Date on which the post is currently scheduled to be published. */ |
|
241 |
$stamp = __( 'Scheduled for: %s' ); |
|
242 |
} elseif ( 'publish' === $post->post_status || 'private' === $post->post_status ) { // Already published. |
|
243 |
/* translators: Post date information. %s: Date on which the post was published. */ |
|
244 |
$stamp = __( 'Published on: %s' ); |
|
245 |
} elseif ( '0000-00-00 00:00:00' === $post->post_date_gmt ) { // Draft, 1 or more saves, no date specified. |
|
246 |
$stamp = __( 'Publish <b>immediately</b>' ); |
|
247 |
} elseif ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) { // Draft, 1 or more saves, future date specified. |
|
248 |
/* translators: Post date information. %s: Date on which the post is to be published. */ |
|
249 |
$stamp = __( 'Schedule for: %s' ); |
|
250 |
} else { // Draft, 1 or more saves, date specified. |
|
251 |
/* translators: Post date information. %s: Date on which the post is to be published. */ |
|
252 |
$stamp = __( 'Publish on: %s' ); |
|
253 |
} |
|
254 |
$date = sprintf( |
|
255 |
$date_string, |
|
256 |
date_i18n( $date_format, strtotime( $post->post_date ) ), |
|
257 |
date_i18n( $time_format, strtotime( $post->post_date ) ) |
|
258 |
); |
|
259 |
} else { // Draft (no saves, and thus no date specified). |
|
9 | 260 |
$stamp = __( 'Publish <b>immediately</b>' ); |
16 | 261 |
$date = sprintf( |
262 |
$date_string, |
|
263 |
date_i18n( $date_format, strtotime( current_time( 'mysql' ) ) ), |
|
264 |
date_i18n( $time_format, strtotime( current_time( 'mysql' ) ) ) |
|
265 |
); |
|
9 | 266 |
} |
16 | 267 |
|
268 |
if ( ! empty( $args['args']['revisions_count'] ) ) : |
|
269 |
?> |
|
270 |
<div class="misc-pub-section misc-pub-revisions"> |
|
271 |
<?php |
|
272 |
/* translators: Post revisions heading. %s: The number of available revisions. */ |
|
273 |
printf( __( 'Revisions: %s' ), '<b>' . number_format_i18n( $args['args']['revisions_count'] ) . '</b>' ); |
|
274 |
?> |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
275 |
<a class="hide-if-no-js" href="<?php echo esc_url( get_edit_post_link( $args['args']['revision_id'] ) ); ?>"><span aria-hidden="true"><?php _ex( 'Browse', 'revisions' ); ?></span> <span class="screen-reader-text"> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
276 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
277 |
/* translators: Hidden accessibility text. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
278 |
_e( 'Browse revisions' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
279 |
?> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
280 |
</span></a> |
16 | 281 |
</div> |
282 |
<?php |
|
283 |
endif; |
|
284 |
||
285 |
if ( $can_publish ) : // Contributors don't get to choose the date of publish. |
|
286 |
?> |
|
287 |
<div class="misc-pub-section curtime misc-pub-curtime"> |
|
288 |
<span id="timestamp"> |
|
289 |
<?php printf( $stamp, '<b>' . $date . '</b>' ); ?> |
|
290 |
</span> |
|
291 |
<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" role="button"> |
|
292 |
<span aria-hidden="true"><?php _e( 'Edit' ); ?></span> |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
293 |
<span class="screen-reader-text"> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
294 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
295 |
/* translators: Hidden accessibility text. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
296 |
_e( 'Edit date and time' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
297 |
?> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
298 |
</span> |
16 | 299 |
</a> |
300 |
<fieldset id="timestampdiv" class="hide-if-js"> |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
301 |
<legend class="screen-reader-text"> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
302 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
303 |
/* translators: Hidden accessibility text. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
304 |
_e( 'Date and time' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
305 |
?> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
306 |
</legend> |
16 | 307 |
<?php touch_time( ( 'edit' === $action ), 1 ); ?> |
308 |
</fieldset> |
|
309 |
</div> |
|
310 |
<?php |
|
311 |
endif; |
|
0 | 312 |
|
16 | 313 |
if ( 'draft' === $post->post_status && get_post_meta( $post_id, '_customize_changeset_uuid', true ) ) : |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
314 |
$message = sprintf( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
315 |
/* translators: %s: URL to the Customizer. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
316 |
__( 'This draft comes from your <a href="%s">unpublished customization changes</a>. You can edit, but there is no need to publish now. It will be published automatically with those changes.' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
317 |
esc_url( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
318 |
add_query_arg( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
319 |
'changeset_uuid', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
320 |
rawurlencode( get_post_meta( $post_id, '_customize_changeset_uuid', true ) ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
321 |
admin_url( 'customize.php' ) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
322 |
) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
323 |
) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
324 |
); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
325 |
wp_admin_notice( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
326 |
$message, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
327 |
array( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
328 |
'type' => 'info', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
329 |
'additional_classes' => array( 'notice-alt', 'inline' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
330 |
) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
331 |
); |
16 | 332 |
endif; |
0 | 333 |
|
16 | 334 |
/** |
335 |
* Fires after the post time/date setting in the Publish meta box. |
|
336 |
* |
|
337 |
* @since 2.9.0 |
|
338 |
* @since 4.4.0 Added the `$post` parameter. |
|
339 |
* |
|
340 |
* @param WP_Post $post WP_Post object for the current post. |
|
341 |
*/ |
|
342 |
do_action( 'post_submitbox_misc_actions', $post ); |
|
9 | 343 |
?> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
344 |
</div> |
16 | 345 |
<div class="clear"></div> |
0 | 346 |
</div> |
347 |
||
348 |
<div id="major-publishing-actions"> |
|
9 | 349 |
<?php |
350 |
/** |
|
351 |
* Fires at the beginning of the publishing actions section of the Publish meta box. |
|
352 |
* |
|
353 |
* @since 2.7.0 |
|
354 |
* @since 4.9.0 Added the `$post` parameter. |
|
355 |
* |
|
356 |
* @param WP_Post|null $post WP_Post object for the current post on Edit Post screen, |
|
357 |
* null on Edit Link screen. |
|
358 |
*/ |
|
359 |
do_action( 'post_submitbox_start', $post ); |
|
360 |
?> |
|
16 | 361 |
<div id="delete-action"> |
362 |
<?php |
|
363 |
if ( current_user_can( 'delete_post', $post_id ) ) { |
|
364 |
if ( ! EMPTY_TRASH_DAYS ) { |
|
365 |
$delete_text = __( 'Delete permanently' ); |
|
366 |
} else { |
|
367 |
$delete_text = __( 'Move to Trash' ); |
|
368 |
} |
|
369 |
?> |
|
370 |
<a class="submitdelete deletion" href="<?php echo get_delete_post_link( $post_id ); ?>"><?php echo $delete_text; ?></a> |
|
371 |
<?php |
|
9 | 372 |
} |
373 |
?> |
|
16 | 374 |
</div> |
375 |
||
376 |
<div id="publishing-action"> |
|
377 |
<span class="spinner"></span> |
|
378 |
<?php |
|
379 |
if ( ! in_array( $post->post_status, array( 'publish', 'future', 'private' ), true ) || 0 === $post_id ) { |
|
380 |
if ( $can_publish ) : |
|
381 |
if ( ! empty( $post->post_date_gmt ) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : |
|
382 |
?> |
|
383 |
<input name="original_publish" type="hidden" id="original_publish" value="<?php echo esc_attr_x( 'Schedule', 'post action/button label' ); ?>" /> |
|
384 |
<?php submit_button( _x( 'Schedule', 'post action/button label' ), 'primary large', 'publish', false ); ?> |
|
385 |
<?php |
|
386 |
else : |
|
387 |
?> |
|
388 |
<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e( 'Publish' ); ?>" /> |
|
389 |
<?php submit_button( __( 'Publish' ), 'primary large', 'publish', false ); ?> |
|
390 |
<?php |
|
391 |
endif; |
|
392 |
else : |
|
393 |
?> |
|
394 |
<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e( 'Submit for Review' ); ?>" /> |
|
395 |
<?php submit_button( __( 'Submit for Review' ), 'primary large', 'publish', false ); ?> |
|
396 |
<?php |
|
397 |
endif; |
|
398 |
} else { |
|
399 |
?> |
|
400 |
<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e( 'Update' ); ?>" /> |
|
401 |
<?php submit_button( __( 'Update' ), 'primary large', 'save', false, array( 'id' => 'publish' ) ); ?> |
|
402 |
<?php |
|
403 |
} |
|
404 |
?> |
|
405 |
</div> |
|
406 |
<div class="clear"></div> |
|
0 | 407 |
</div> |
408 |
||
409 |
</div> |
|
9 | 410 |
<?php |
0 | 411 |
} |
412 |
||
413 |
/** |
|
19 | 414 |
* Displays attachment submit form fields. |
0 | 415 |
* |
416 |
* @since 3.5.0 |
|
417 |
* |
|
19 | 418 |
* @param WP_Post $post Current post object. |
0 | 419 |
*/ |
420 |
function attachment_submit_meta_box( $post ) { |
|
9 | 421 |
?> |
0 | 422 |
<div class="submitbox" id="submitpost"> |
423 |
||
424 |
<div id="minor-publishing"> |
|
425 |
||
16 | 426 |
<?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key. ?> |
0 | 427 |
<div style="display:none;"> |
9 | 428 |
<?php submit_button( __( 'Save' ), '', 'save' ); ?> |
0 | 429 |
</div> |
430 |
||
431 |
||
432 |
<div id="misc-publishing-actions"> |
|
433 |
<div class="misc-pub-section curtime misc-pub-curtime"> |
|
9 | 434 |
<span id="timestamp"> |
16 | 435 |
<?php |
436 |
$uploaded_on = sprintf( |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
437 |
/* translators: Publish box date string. 1: Date, 2: Time. */ |
16 | 438 |
__( '%1$s at %2$s' ), |
18 | 439 |
/* translators: Publish box date format, see https://www.php.net/manual/datetime.format.php */ |
16 | 440 |
date_i18n( _x( 'M j, Y', 'publish box date format' ), strtotime( $post->post_date ) ), |
18 | 441 |
/* translators: Publish box time format, see https://www.php.net/manual/datetime.format.php */ |
16 | 442 |
date_i18n( _x( 'H:i', 'publish box time format' ), strtotime( $post->post_date ) ) |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
443 |
); |
16 | 444 |
/* translators: Attachment information. %s: Date the attachment was uploaded. */ |
445 |
printf( __( 'Uploaded on: %s' ), '<b>' . $uploaded_on . '</b>' ); |
|
446 |
?> |
|
9 | 447 |
</span> |
0 | 448 |
</div><!-- .misc-pub-section --> |
449 |
||
5 | 450 |
<?php |
451 |
/** |
|
452 |
* Fires after the 'Uploaded on' section of the Save meta box |
|
453 |
* in the attachment editing screen. |
|
454 |
* |
|
455 |
* @since 3.5.0 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
456 |
* @since 4.9.0 Added the `$post` parameter. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
457 |
* |
9 | 458 |
* @param WP_Post $post WP_Post object for the current attachment. |
5 | 459 |
*/ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
460 |
do_action( 'attachment_submitbox_misc_actions', $post ); |
5 | 461 |
?> |
0 | 462 |
</div><!-- #misc-publishing-actions --> |
463 |
<div class="clear"></div> |
|
464 |
</div><!-- #minor-publishing --> |
|
465 |
||
466 |
<div id="major-publishing-actions"> |
|
467 |
<div id="delete-action"> |
|
468 |
<?php |
|
9 | 469 |
if ( current_user_can( 'delete_post', $post->ID ) ) { |
0 | 470 |
if ( EMPTY_TRASH_DAYS && MEDIA_TRASH ) { |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
471 |
printf( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
472 |
'<a class="submitdelete deletion" href="%1$s">%2$s</a>', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
473 |
get_delete_post_link( $post->ID ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
474 |
__( 'Move to Trash' ) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
475 |
); |
0 | 476 |
} else { |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
477 |
$show_confirmation = ! MEDIA_TRASH ? " onclick='return showNotice.warn();'" : ''; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
478 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
479 |
printf( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
480 |
'<a class="submitdelete deletion"%1$s href="%2$s">%3$s</a>', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
481 |
$show_confirmation, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
482 |
get_delete_post_link( $post->ID, '', true ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
483 |
__( 'Delete permanently' ) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
484 |
); |
0 | 485 |
} |
9 | 486 |
} |
0 | 487 |
?> |
488 |
</div> |
|
489 |
||
490 |
<div id="publishing-action"> |
|
491 |
<span class="spinner"></span> |
|
9 | 492 |
<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e( 'Update' ); ?>" /> |
493 |
<input name="save" type="submit" class="button button-primary button-large" id="publish" value="<?php esc_attr_e( 'Update' ); ?>" /> |
|
0 | 494 |
</div> |
495 |
<div class="clear"></div> |
|
496 |
</div><!-- #major-publishing-actions --> |
|
497 |
||
498 |
</div> |
|
499 |
||
9 | 500 |
<?php |
0 | 501 |
} |
502 |
||
503 |
/** |
|
19 | 504 |
* Displays post format form elements. |
0 | 505 |
* |
506 |
* @since 3.1.0 |
|
507 |
* |
|
19 | 508 |
* @param WP_Post $post Current post object. |
5 | 509 |
* @param array $box { |
510 |
* Post formats meta box arguments. |
|
511 |
* |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
512 |
* @type string $id Meta box 'id' attribute. |
5 | 513 |
* @type string $title Meta box title. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
514 |
* @type callable $callback Meta box display callback. |
5 | 515 |
* @type array $args Extra meta box arguments. |
516 |
* } |
|
0 | 517 |
*/ |
518 |
function post_format_meta_box( $post, $box ) { |
|
519 |
if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post->post_type, 'post-formats' ) ) : |
|
9 | 520 |
$post_formats = get_theme_support( 'post-formats' ); |
0 | 521 |
|
9 | 522 |
if ( is_array( $post_formats[0] ) ) : |
523 |
$post_format = get_post_format( $post->ID ); |
|
524 |
if ( ! $post_format ) { |
|
525 |
$post_format = '0'; |
|
526 |
} |
|
19 | 527 |
// Add in the current one if it isn't there yet, in case the active theme doesn't support it. |
16 | 528 |
if ( $post_format && ! in_array( $post_format, $post_formats[0], true ) ) { |
9 | 529 |
$post_formats[0][] = $post_format; |
530 |
} |
|
531 |
?> |
|
532 |
<div id="post-formats-select"> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
533 |
<fieldset> |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
534 |
<legend class="screen-reader-text"> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
535 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
536 |
/* translators: Hidden accessibility text. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
537 |
_e( 'Post Formats' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
538 |
?> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
539 |
</legend> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
540 |
<input type="radio" name="post_format" class="post-format" id="post-format-0" value="0" <?php checked( $post_format, '0' ); ?> /> <label for="post-format-0" class="post-format-icon post-format-standard"><?php echo get_post_format_string( 'standard' ); ?></label> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
541 |
<?php foreach ( $post_formats[0] as $format ) : ?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
542 |
<br /><input type="radio" name="post_format" class="post-format" id="post-format-<?php echo esc_attr( $format ); ?>" value="<?php echo esc_attr( $format ); ?>" <?php checked( $post_format, $format ); ?> /> <label for="post-format-<?php echo esc_attr( $format ); ?>" class="post-format-icon post-format-<?php echo esc_attr( $format ); ?>"><?php echo esc_html( get_post_format_string( $format ) ); ?></label> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
543 |
<?php endforeach; ?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
544 |
</fieldset> |
0 | 545 |
</div> |
9 | 546 |
<?php |
547 |
endif; |
|
548 |
endif; |
|
0 | 549 |
} |
550 |
||
551 |
/** |
|
19 | 552 |
* Displays post tags form fields. |
0 | 553 |
* |
554 |
* @since 2.6.0 |
|
555 |
* |
|
5 | 556 |
* @todo Create taxonomy-agnostic wrapper for this. |
557 |
* |
|
19 | 558 |
* @param WP_Post $post Current post object. |
5 | 559 |
* @param array $box { |
560 |
* Tags meta box arguments. |
|
561 |
* |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
562 |
* @type string $id Meta box 'id' attribute. |
5 | 563 |
* @type string $title Meta box title. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
564 |
* @type callable $callback Meta box display callback. |
5 | 565 |
* @type array $args { |
566 |
* Extra meta box arguments. |
|
567 |
* |
|
568 |
* @type string $taxonomy Taxonomy. Default 'post_tag'. |
|
569 |
* } |
|
570 |
* } |
|
0 | 571 |
*/ |
5 | 572 |
function post_tags_meta_box( $post, $box ) { |
573 |
$defaults = array( 'taxonomy' => 'post_tag' ); |
|
574 |
if ( ! isset( $box['args'] ) || ! is_array( $box['args'] ) ) { |
|
0 | 575 |
$args = array(); |
5 | 576 |
} else { |
0 | 577 |
$args = $box['args']; |
5 | 578 |
} |
16 | 579 |
$parsed_args = wp_parse_args( $args, $defaults ); |
580 |
$tax_name = esc_attr( $parsed_args['taxonomy'] ); |
|
581 |
$taxonomy = get_taxonomy( $parsed_args['taxonomy'] ); |
|
0 | 582 |
$user_can_assign_terms = current_user_can( $taxonomy->cap->assign_terms ); |
9 | 583 |
$comma = _x( ',', 'tag delimiter' ); |
584 |
$terms_to_edit = get_terms_to_edit( $post->ID, $tax_name ); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
585 |
if ( ! is_string( $terms_to_edit ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
586 |
$terms_to_edit = ''; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
587 |
} |
9 | 588 |
?> |
0 | 589 |
<div class="tagsdiv" id="<?php echo $tax_name; ?>"> |
590 |
<div class="jaxtag"> |
|
591 |
<div class="nojs-tags hide-if-js"> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
592 |
<label for="tax-input-<?php echo $tax_name; ?>"><?php echo $taxonomy->labels->add_or_remove_items; ?></label> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
593 |
<p><textarea name="<?php echo "tax_input[$tax_name]"; ?>" rows="3" cols="20" class="the-tags" id="tax-input-<?php echo $tax_name; ?>" <?php disabled( ! $user_can_assign_terms ); ?> aria-describedby="new-tag-<?php echo $tax_name; ?>-desc"><?php echo str_replace( ',', $comma . ' ', $terms_to_edit ); // textarea_escaped by esc_attr() ?></textarea></p> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
594 |
</div> |
9 | 595 |
<?php if ( $user_can_assign_terms ) : ?> |
0 | 596 |
<div class="ajaxtag hide-if-no-js"> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
597 |
<label class="screen-reader-text" for="new-tag-<?php echo $tax_name; ?>"><?php echo $taxonomy->labels->add_new_item; ?></label> |
9 | 598 |
<input data-wp-taxonomy="<?php echo $tax_name; ?>" type="text" id="new-tag-<?php echo $tax_name; ?>" name="newtag[<?php echo $tax_name; ?>]" class="newtag form-input-tip" size="16" autocomplete="off" aria-describedby="new-tag-<?php echo $tax_name; ?>-desc" value="" /> |
599 |
<input type="button" class="button tagadd" value="<?php esc_attr_e( 'Add' ); ?>" /> |
|
0 | 600 |
</div> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
601 |
<p class="howto" id="new-tag-<?php echo $tax_name; ?>-desc"><?php echo $taxonomy->labels->separate_items_with_commas; ?></p> |
9 | 602 |
<?php elseif ( empty( $terms_to_edit ) ) : ?> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
603 |
<p><?php echo $taxonomy->labels->no_terms; ?></p> |
0 | 604 |
<?php endif; ?> |
605 |
</div> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
606 |
<ul class="tagchecklist" role="list"></ul> |
0 | 607 |
</div> |
9 | 608 |
<?php if ( $user_can_assign_terms ) : ?> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
609 |
<p class="hide-if-no-js"><button type="button" class="button-link tagcloud-link" id="link-<?php echo $tax_name; ?>" aria-expanded="false"><?php echo $taxonomy->labels->choose_from_most_used; ?></button></p> |
0 | 610 |
<?php endif; ?> |
9 | 611 |
<?php |
0 | 612 |
} |
613 |
||
614 |
/** |
|
19 | 615 |
* Displays post categories form fields. |
0 | 616 |
* |
617 |
* @since 2.6.0 |
|
618 |
* |
|
5 | 619 |
* @todo Create taxonomy-agnostic wrapper for this. |
620 |
* |
|
19 | 621 |
* @param WP_Post $post Current post object. |
5 | 622 |
* @param array $box { |
623 |
* Categories meta box arguments. |
|
624 |
* |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
625 |
* @type string $id Meta box 'id' attribute. |
5 | 626 |
* @type string $title Meta box title. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
627 |
* @type callable $callback Meta box display callback. |
5 | 628 |
* @type array $args { |
629 |
* Extra meta box arguments. |
|
630 |
* |
|
631 |
* @type string $taxonomy Taxonomy. Default 'category'. |
|
632 |
* } |
|
633 |
* } |
|
0 | 634 |
*/ |
635 |
function post_categories_meta_box( $post, $box ) { |
|
5 | 636 |
$defaults = array( 'taxonomy' => 'category' ); |
637 |
if ( ! isset( $box['args'] ) || ! is_array( $box['args'] ) ) { |
|
0 | 638 |
$args = array(); |
5 | 639 |
} else { |
0 | 640 |
$args = $box['args']; |
5 | 641 |
} |
16 | 642 |
$parsed_args = wp_parse_args( $args, $defaults ); |
643 |
$tax_name = esc_attr( $parsed_args['taxonomy'] ); |
|
644 |
$taxonomy = get_taxonomy( $parsed_args['taxonomy'] ); |
|
0 | 645 |
?> |
5 | 646 |
<div id="taxonomy-<?php echo $tax_name; ?>" class="categorydiv"> |
647 |
<ul id="<?php echo $tax_name; ?>-tabs" class="category-tabs"> |
|
648 |
<li class="tabs"><a href="#<?php echo $tax_name; ?>-all"><?php echo $taxonomy->labels->all_items; ?></a></li> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
649 |
<li class="hide-if-no-js"><a href="#<?php echo $tax_name; ?>-pop"><?php echo esc_html( $taxonomy->labels->most_used ); ?></a></li> |
0 | 650 |
</ul> |
651 |
||
5 | 652 |
<div id="<?php echo $tax_name; ?>-pop" class="tabs-panel" style="display: none;"> |
653 |
<ul id="<?php echo $tax_name; ?>checklist-pop" class="categorychecklist form-no-clear" > |
|
654 |
<?php $popular_ids = wp_popular_terms_checklist( $tax_name ); ?> |
|
0 | 655 |
</ul> |
656 |
</div> |
|
657 |
||
5 | 658 |
<div id="<?php echo $tax_name; ?>-all" class="tabs-panel"> |
0 | 659 |
<?php |
16 | 660 |
$name = ( 'category' === $tax_name ) ? 'post_category' : 'tax_input[' . $tax_name . ']'; |
661 |
// Allows for an empty term set to be sent. 0 is an invalid term ID and will be ignored by empty() checks. |
|
662 |
echo "<input type='hidden' name='{$name}[]' value='0' />"; |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
663 |
?> |
5 | 664 |
<ul id="<?php echo $tax_name; ?>checklist" data-wp-lists="list:<?php echo $tax_name; ?>" class="categorychecklist form-no-clear"> |
9 | 665 |
<?php |
666 |
wp_terms_checklist( |
|
667 |
$post->ID, |
|
668 |
array( |
|
669 |
'taxonomy' => $tax_name, |
|
670 |
'popular_cats' => $popular_ids, |
|
671 |
) |
|
672 |
); |
|
673 |
?> |
|
0 | 674 |
</ul> |
675 |
</div> |
|
5 | 676 |
<?php if ( current_user_can( $taxonomy->cap->edit_terms ) ) : ?> |
677 |
<div id="<?php echo $tax_name; ?>-adder" class="wp-hidden-children"> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
678 |
<a id="<?php echo $tax_name; ?>-add-toggle" href="#<?php echo $tax_name; ?>-add" class="hide-if-no-js taxonomy-add-new"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
679 |
<?php |
16 | 680 |
/* translators: %s: Add New taxonomy label. */ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
681 |
printf( __( '+ %s' ), $taxonomy->labels->add_new_item ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
682 |
?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
683 |
</a> |
5 | 684 |
<p id="<?php echo $tax_name; ?>-add" class="category-add wp-hidden-child"> |
685 |
<label class="screen-reader-text" for="new<?php echo $tax_name; ?>"><?php echo $taxonomy->labels->add_new_item; ?></label> |
|
18 | 686 |
<input type="text" name="new<?php echo $tax_name; ?>" id="new<?php echo $tax_name; ?>" class="form-required form-input-tip" value="<?php echo esc_attr( $taxonomy->labels->new_item_name ); ?>" aria-required="true" /> |
5 | 687 |
<label class="screen-reader-text" for="new<?php echo $tax_name; ?>_parent"> |
688 |
<?php echo $taxonomy->labels->parent_item_colon; ?> |
|
0 | 689 |
</label> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
690 |
<?php |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
691 |
$parent_dropdown_args = array( |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
692 |
'taxonomy' => $tax_name, |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
693 |
'hide_empty' => 0, |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
694 |
'name' => 'new' . $tax_name . '_parent', |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
695 |
'orderby' => 'name', |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
696 |
'hierarchical' => 1, |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
697 |
'show_option_none' => '— ' . $taxonomy->labels->parent_item . ' —', |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
698 |
); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
699 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
700 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
701 |
* Filters the arguments for the taxonomy parent dropdown on the Post Edit page. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
702 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
703 |
* @since 4.4.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
704 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
705 |
* @param array $parent_dropdown_args { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
706 |
* Optional. Array of arguments to generate parent dropdown. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
707 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
708 |
* @type string $taxonomy Name of the taxonomy to retrieve. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
709 |
* @type bool $hide_if_empty True to skip generating markup if no |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
710 |
* categories are found. Default 0. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
711 |
* @type string $name Value for the 'name' attribute |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
712 |
* of the select element. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
713 |
* Default "new{$tax_name}_parent". |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
714 |
* @type string $orderby Which column to use for ordering |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
715 |
* terms. Default 'name'. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
716 |
* @type bool|int $hierarchical Whether to traverse the taxonomy |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
717 |
* hierarchy. Default 1. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
718 |
* @type string $show_option_none Text to display for the "none" option. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
719 |
* Default "— {$parent} —", |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
720 |
* where `$parent` is 'parent_item' |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
721 |
* taxonomy label. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
722 |
* } |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
723 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
724 |
$parent_dropdown_args = apply_filters( 'post_edit_category_parent_dropdown_args', $parent_dropdown_args ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
725 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
726 |
wp_dropdown_categories( $parent_dropdown_args ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
727 |
?> |
5 | 728 |
<input type="button" id="<?php echo $tax_name; ?>-add-submit" data-wp-lists="add:<?php echo $tax_name; ?>checklist:<?php echo $tax_name; ?>-add" class="button category-add-submit" value="<?php echo esc_attr( $taxonomy->labels->add_new_item ); ?>" /> |
729 |
<?php wp_nonce_field( 'add-' . $tax_name, '_ajax_nonce-add-' . $tax_name, false ); ?> |
|
730 |
<span id="<?php echo $tax_name; ?>-ajax-response"></span> |
|
0 | 731 |
</p> |
732 |
</div> |
|
733 |
<?php endif; ?> |
|
734 |
</div> |
|
735 |
<?php |
|
736 |
} |
|
737 |
||
738 |
/** |
|
19 | 739 |
* Displays post excerpt form fields. |
0 | 740 |
* |
741 |
* @since 2.6.0 |
|
742 |
* |
|
19 | 743 |
* @param WP_Post $post Current post object. |
0 | 744 |
*/ |
9 | 745 |
function post_excerpt_meta_box( $post ) { |
746 |
?> |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
747 |
<label class="screen-reader-text" for="excerpt"> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
748 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
749 |
/* translators: Hidden accessibility text. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
750 |
_e( 'Excerpt' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
751 |
?> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
752 |
</label><textarea rows="1" cols="40" name="excerpt" id="excerpt"><?php echo $post->post_excerpt; // textarea_escaped ?></textarea> |
9 | 753 |
<p> |
754 |
<?php |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
755 |
printf( |
16 | 756 |
/* translators: %s: Documentation URL. */ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
757 |
__( 'Excerpts are optional hand-crafted summaries of your content that can be used in your theme. <a href="%s">Learn more about manual excerpts</a>.' ), |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
758 |
__( 'https://wordpress.org/documentation/article/what-is-an-excerpt-classic-editor/' ) |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
759 |
); |
9 | 760 |
?> |
761 |
</p> |
|
762 |
<?php |
|
0 | 763 |
} |
764 |
||
765 |
/** |
|
19 | 766 |
* Displays trackback links form fields. |
0 | 767 |
* |
768 |
* @since 2.6.0 |
|
769 |
* |
|
19 | 770 |
* @param WP_Post $post Current post object. |
0 | 771 |
*/ |
9 | 772 |
function post_trackback_meta_box( $post ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
773 |
$form_trackback = '<input type="text" name="trackback_url" id="trackback_url" class="code" value="' . |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
774 |
esc_attr( str_replace( "\n", ' ', $post->to_ping ) ) . '" aria-describedby="trackback-url-desc" />'; |
16 | 775 |
|
776 |
if ( '' !== $post->pinged ) { |
|
9 | 777 |
$pings = '<p>' . __( 'Already pinged:' ) . '</p><ul>'; |
778 |
$already_pinged = explode( "\n", trim( $post->pinged ) ); |
|
779 |
foreach ( $already_pinged as $pinged_url ) { |
|
780 |
$pings .= "\n\t<li>" . esc_html( $pinged_url ) . '</li>'; |
|
0 | 781 |
} |
782 |
$pings .= '</ul>'; |
|
783 |
} |
|
784 |
||
9 | 785 |
?> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
786 |
<p> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
787 |
<label for="trackback_url"><?php _e( 'Send trackbacks to:' ); ?></label> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
788 |
<?php echo $form_trackback; ?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
789 |
</p> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
790 |
<p id="trackback-url-desc" class="howto"><?php _e( 'Separate multiple URLs with spaces' ); ?></p> |
9 | 791 |
<p> |
792 |
<?php |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
793 |
printf( |
16 | 794 |
/* translators: %s: Documentation URL. */ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
795 |
__( 'Trackbacks are a way to notify legacy blog systems that you’ve linked to them. If you link other WordPress sites, they’ll be notified automatically using <a href="%s">pingbacks</a>, no other action necessary.' ), |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
796 |
__( 'https://wordpress.org/documentation/article/introduction-to-blogging/#comments' ) |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
797 |
); |
9 | 798 |
?> |
799 |
</p> |
|
800 |
<?php |
|
801 |
if ( ! empty( $pings ) ) { |
|
802 |
echo $pings; |
|
803 |
} |
|
0 | 804 |
} |
805 |
||
806 |
/** |
|
19 | 807 |
* Displays custom fields form fields. |
0 | 808 |
* |
809 |
* @since 2.6.0 |
|
810 |
* |
|
19 | 811 |
* @param WP_Post $post Current post object. |
0 | 812 |
*/ |
9 | 813 |
function post_custom_meta_box( $post ) { |
814 |
?> |
|
0 | 815 |
<div id="postcustomstuff"> |
816 |
<div id="ajax-response"></div> |
|
9 | 817 |
<?php |
818 |
$metadata = has_meta( $post->ID ); |
|
819 |
foreach ( $metadata as $key => $value ) { |
|
820 |
if ( is_protected_meta( $metadata[ $key ]['meta_key'], 'post' ) || ! current_user_can( 'edit_post_meta', $post->ID, $metadata[ $key ]['meta_key'] ) ) { |
|
821 |
unset( $metadata[ $key ] ); |
|
822 |
} |
|
823 |
} |
|
824 |
list_meta( $metadata ); |
|
825 |
meta_form( $post ); |
|
826 |
?> |
|
0 | 827 |
</div> |
9 | 828 |
<p> |
829 |
<?php |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
830 |
printf( |
16 | 831 |
/* translators: %s: Documentation URL. */ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
832 |
__( 'Custom fields can be used to add extra metadata to a post that you can <a href="%s">use in your theme</a>.' ), |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
833 |
__( 'https://wordpress.org/documentation/article/assign-custom-fields/' ) |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
834 |
); |
9 | 835 |
?> |
836 |
</p> |
|
837 |
<?php |
|
0 | 838 |
} |
839 |
||
840 |
/** |
|
19 | 841 |
* Displays comments status form fields. |
0 | 842 |
* |
843 |
* @since 2.6.0 |
|
844 |
* |
|
19 | 845 |
* @param WP_Post $post Current post object. |
0 | 846 |
*/ |
9 | 847 |
function post_comment_status_meta_box( $post ) { |
848 |
?> |
|
0 | 849 |
<input name="advanced_view" type="hidden" value="1" /> |
850 |
<p class="meta-options"> |
|
9 | 851 |
<label for="comment_status" class="selectit"><input name="comment_status" type="checkbox" id="comment_status" value="open" <?php checked( $post->comment_status, 'open' ); ?> /> <?php _e( 'Allow comments' ); ?></label><br /> |
852 |
<label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked( $post->ping_status, 'open' ); ?> /> |
|
853 |
<?php |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
854 |
printf( |
16 | 855 |
/* translators: %s: Documentation URL. */ |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
856 |
__( 'Allow <a href="%s">trackbacks and pingbacks</a>' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
857 |
__( 'https://wordpress.org/documentation/article/introduction-to-blogging/#managing-comments' ) |
9 | 858 |
); |
859 |
?> |
|
860 |
</label> |
|
5 | 861 |
<?php |
862 |
/** |
|
863 |
* Fires at the end of the Discussion meta box on the post editing screen. |
|
864 |
* |
|
865 |
* @since 3.1.0 |
|
866 |
* |
|
19 | 867 |
* @param WP_Post $post WP_Post object for the current post. |
5 | 868 |
*/ |
16 | 869 |
do_action( 'post_comment_status_meta_box-options', $post ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores |
5 | 870 |
?> |
0 | 871 |
</p> |
9 | 872 |
<?php |
0 | 873 |
} |
874 |
||
875 |
/** |
|
19 | 876 |
* Displays comments for post table header |
0 | 877 |
* |
878 |
* @since 3.0.0 |
|
879 |
* |
|
19 | 880 |
* @param array $result Table header rows. |
0 | 881 |
* @return array |
882 |
*/ |
|
9 | 883 |
function post_comment_meta_box_thead( $result ) { |
884 |
unset( $result['cb'], $result['response'] ); |
|
0 | 885 |
return $result; |
886 |
} |
|
887 |
||
888 |
/** |
|
19 | 889 |
* Displays comments for post. |
0 | 890 |
* |
891 |
* @since 2.8.0 |
|
892 |
* |
|
19 | 893 |
* @param WP_Post $post Current post object. |
0 | 894 |
*/ |
895 |
function post_comment_meta_box( $post ) { |
|
896 |
wp_nonce_field( 'get-comments', 'add_comment_nonce', false ); |
|
897 |
?> |
|
16 | 898 |
<p class="hide-if-no-js" id="add-new-comment"><button type="button" class="button" onclick="window.commentReply && commentReply.addcomment(<?php echo $post->ID; ?>);"><?php _e( 'Add Comment' ); ?></button></p> |
0 | 899 |
<?php |
900 |
||
9 | 901 |
$total = get_comments( |
902 |
array( |
|
903 |
'post_id' => $post->ID, |
|
904 |
'count' => true, |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
905 |
'orderby' => 'none', |
9 | 906 |
) |
907 |
); |
|
908 |
$wp_list_table = _get_list_table( 'WP_Post_Comments_List_Table' ); |
|
0 | 909 |
$wp_list_table->display( true ); |
910 |
||
911 |
if ( 1 > $total ) { |
|
9 | 912 |
echo '<p id="no-comments">' . __( 'No comments yet.' ) . '</p>'; |
0 | 913 |
} else { |
914 |
$hidden = get_hidden_meta_boxes( get_current_screen() ); |
|
16 | 915 |
if ( ! in_array( 'commentsdiv', $hidden, true ) ) { |
0 | 916 |
?> |
19 | 917 |
<script type="text/javascript">jQuery(function(){commentsBox.get(<?php echo $total; ?>, 10);});</script> |
0 | 918 |
<?php |
919 |
} |
|
920 |
||
921 |
?> |
|
9 | 922 |
<p class="hide-if-no-js" id="show-comments"><a href="#commentstatusdiv" onclick="commentsBox.load(<?php echo $total; ?>);return false;"><?php _e( 'Show comments' ); ?></a> <span class="spinner"></span></p> |
0 | 923 |
<?php |
924 |
} |
|
925 |
||
926 |
wp_comment_trashnotice(); |
|
927 |
} |
|
928 |
||
929 |
/** |
|
19 | 930 |
* Displays slug form fields. |
0 | 931 |
* |
932 |
* @since 2.6.0 |
|
933 |
* |
|
19 | 934 |
* @param WP_Post $post Current post object. |
0 | 935 |
*/ |
9 | 936 |
function post_slug_meta_box( $post ) { |
937 |
/** This filter is documented in wp-admin/edit-tag-form.php */ |
|
938 |
$editable_slug = apply_filters( 'editable_slug', $post->post_name, $post ); |
|
939 |
?> |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
940 |
<label class="screen-reader-text" for="post_name"> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
941 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
942 |
/* translators: Hidden accessibility text. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
943 |
_e( 'Slug' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
944 |
?> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
945 |
</label><input name="post_name" type="text" class="large-text" id="post_name" value="<?php echo esc_attr( $editable_slug ); ?>" /> |
9 | 946 |
<?php |
0 | 947 |
} |
948 |
||
949 |
/** |
|
19 | 950 |
* Displays form field with list of authors. |
0 | 951 |
* |
952 |
* @since 2.6.0 |
|
953 |
* |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
954 |
* @global int $user_ID |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
955 |
* |
19 | 956 |
* @param WP_Post $post Current post object. |
0 | 957 |
*/ |
9 | 958 |
function post_author_meta_box( $post ) { |
0 | 959 |
global $user_ID; |
19 | 960 |
|
961 |
$post_type_object = get_post_type_object( $post->post_type ); |
|
9 | 962 |
?> |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
963 |
<label class="screen-reader-text" for="post_author_override"> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
964 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
965 |
/* translators: Hidden accessibility text. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
966 |
_e( 'Author' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
967 |
?> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
968 |
</label> |
9 | 969 |
<?php |
970 |
wp_dropdown_users( |
|
971 |
array( |
|
19 | 972 |
'capability' => array( $post_type_object->cap->edit_posts ), |
9 | 973 |
'name' => 'post_author_override', |
974 |
'selected' => empty( $post->ID ) ? $user_ID : $post->post_author, |
|
975 |
'include_selected' => true, |
|
976 |
'show' => 'display_name_with_login', |
|
977 |
) |
|
978 |
); |
|
0 | 979 |
} |
980 |
||
981 |
/** |
|
19 | 982 |
* Displays list of revisions. |
0 | 983 |
* |
984 |
* @since 2.6.0 |
|
985 |
* |
|
19 | 986 |
* @param WP_Post $post Current post object. |
0 | 987 |
*/ |
988 |
function post_revisions_meta_box( $post ) { |
|
989 |
wp_list_post_revisions( $post ); |
|
990 |
} |
|
991 |
||
16 | 992 |
// |
993 |
// Page-related Meta Boxes. |
|
994 |
// |
|
0 | 995 |
|
996 |
/** |
|
19 | 997 |
* Displays page attributes form fields. |
0 | 998 |
* |
999 |
* @since 2.7.0 |
|
1000 |
* |
|
19 | 1001 |
* @param WP_Post $post Current post object. |
0 | 1002 |
*/ |
9 | 1003 |
function page_attributes_meta_box( $post ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1004 |
if ( is_post_type_hierarchical( $post->post_type ) ) : |
0 | 1005 |
$dropdown_args = array( |
1006 |
'post_type' => $post->post_type, |
|
1007 |
'exclude_tree' => $post->ID, |
|
1008 |
'selected' => $post->post_parent, |
|
1009 |
'name' => 'parent_id', |
|
9 | 1010 |
'show_option_none' => __( '(no parent)' ), |
0 | 1011 |
'sort_column' => 'menu_order, post_title', |
1012 |
'echo' => 0, |
|
1013 |
); |
|
1014 |
||
5 | 1015 |
/** |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1016 |
* Filters the arguments used to generate a Pages drop-down element. |
5 | 1017 |
* |
1018 |
* @since 3.3.0 |
|
1019 |
* |
|
1020 |
* @see wp_dropdown_pages() |
|
1021 |
* |
|
1022 |
* @param array $dropdown_args Array of arguments used to generate the pages drop-down. |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1023 |
* @param WP_Post $post The current post. |
5 | 1024 |
*/ |
0 | 1025 |
$dropdown_args = apply_filters( 'page_attributes_dropdown_pages_args', $dropdown_args, $post ); |
9 | 1026 |
$pages = wp_dropdown_pages( $dropdown_args ); |
1027 |
if ( ! empty( $pages ) ) : |
|
1028 |
?> |
|
16 | 1029 |
<p class="post-attributes-label-wrapper parent-id-label-wrapper"><label class="post-attributes-label" for="parent_id"><?php _e( 'Parent' ); ?></label></p> |
9 | 1030 |
<?php echo $pages; ?> |
1031 |
<?php |
|
16 | 1032 |
endif; // End empty pages check. |
1033 |
endif; // End hierarchical check. |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1034 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1035 |
if ( count( get_page_templates( $post ) ) > 0 && (int) get_option( 'page_for_posts' ) !== $post->ID ) : |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1036 |
$template = ! empty( $post->page_template ) ? $post->page_template : false; |
0 | 1037 |
?> |
16 | 1038 |
<p class="post-attributes-label-wrapper page-template-label-wrapper"><label class="post-attributes-label" for="page_template"><?php _e( 'Template' ); ?></label> |
9 | 1039 |
<?php |
1040 |
/** |
|
1041 |
* Fires immediately after the label inside the 'Template' section |
|
1042 |
* of the 'Page Attributes' meta box. |
|
1043 |
* |
|
1044 |
* @since 4.4.0 |
|
1045 |
* |
|
19 | 1046 |
* @param string|false $template The template used for the current post. |
1047 |
* @param WP_Post $post The current post. |
|
9 | 1048 |
*/ |
1049 |
do_action( 'page_attributes_meta_box_template', $template, $post ); |
|
1050 |
?> |
|
1051 |
</p> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1052 |
<select name="page_template" id="page_template"> |
9 | 1053 |
<?php |
1054 |
/** |
|
1055 |
* Filters the title of the default page template displayed in the drop-down. |
|
1056 |
* |
|
1057 |
* @since 4.1.0 |
|
1058 |
* |
|
1059 |
* @param string $label The display value for the default page template title. |
|
1060 |
* @param string $context Where the option label is displayed. Possible values |
|
1061 |
* include 'meta-box' or 'quick-edit'. |
|
1062 |
*/ |
|
16 | 1063 |
$default_title = apply_filters( 'default_page_template_title', __( 'Default template' ), 'meta-box' ); |
9 | 1064 |
?> |
5 | 1065 |
<option value="default"><?php echo esc_html( $default_title ); ?></option> |
9 | 1066 |
<?php page_template_dropdown( $template, $post->post_type ); ?> |
0 | 1067 |
</select> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1068 |
<?php endif; ?> |
9 | 1069 |
<?php if ( post_type_supports( $post->post_type, 'page-attributes' ) ) : ?> |
16 | 1070 |
<p class="post-attributes-label-wrapper menu-order-label-wrapper"><label class="post-attributes-label" for="menu_order"><?php _e( 'Order' ); ?></label></p> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1071 |
<input name="menu_order" type="text" size="4" id="menu_order" value="<?php echo esc_attr( $post->menu_order ); ?>" /> |
9 | 1072 |
<?php |
1073 |
/** |
|
1074 |
* Fires before the help hint text in the 'Page Attributes' meta box. |
|
1075 |
* |
|
1076 |
* @since 4.9.0 |
|
1077 |
* |
|
1078 |
* @param WP_Post $post The current post. |
|
1079 |
*/ |
|
1080 |
do_action( 'page_attributes_misc_attributes', $post ); |
|
1081 |
?> |
|
16 | 1082 |
<?php if ( 'page' === $post->post_type && get_current_screen()->get_help_tabs() ) : ?> |
1083 |
<p class="post-attributes-help-text"><?php _e( 'Need help? Use the Help tab above the screen title.' ); ?></p> |
|
9 | 1084 |
<?php |
1085 |
endif; |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1086 |
endif; |
0 | 1087 |
} |
1088 |
||
16 | 1089 |
// |
1090 |
// Link-related Meta Boxes. |
|
1091 |
// |
|
0 | 1092 |
|
1093 |
/** |
|
19 | 1094 |
* Displays link create form fields. |
0 | 1095 |
* |
1096 |
* @since 2.7.0 |
|
1097 |
* |
|
19 | 1098 |
* @param object $link Current link object. |
0 | 1099 |
*/ |
9 | 1100 |
function link_submit_meta_box( $link ) { |
1101 |
?> |
|
0 | 1102 |
<div class="submitbox" id="submitlink"> |
1103 |
||
1104 |
<div id="minor-publishing"> |
|
1105 |
||
16 | 1106 |
<?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key. ?> |
0 | 1107 |
<div style="display:none;"> |
9 | 1108 |
<?php submit_button( __( 'Save' ), '', 'save', false ); ?> |
0 | 1109 |
</div> |
1110 |
||
1111 |
<div id="minor-publishing-actions"> |
|
1112 |
<div id="preview-action"> |
|
9 | 1113 |
<?php if ( ! empty( $link->link_id ) ) { ?> |
1114 |
<a class="preview button" href="<?php echo $link->link_url; ?>" target="_blank"><?php _e( 'Visit Link' ); ?></a> |
|
0 | 1115 |
<?php } ?> |
1116 |
</div> |
|
1117 |
<div class="clear"></div> |
|
1118 |
</div> |
|
1119 |
||
1120 |
<div id="misc-publishing-actions"> |
|
1121 |
<div class="misc-pub-section misc-pub-private"> |
|
9 | 1122 |
<label for="link_private" class="selectit"><input id="link_private" name="link_visible" type="checkbox" value="N" <?php checked( $link->link_visible, 'N' ); ?> /> <?php _e( 'Keep this link private' ); ?></label> |
0 | 1123 |
</div> |
1124 |
</div> |
|
1125 |
||
1126 |
</div> |
|
1127 |
||
1128 |
<div id="major-publishing-actions"> |
|
9 | 1129 |
<?php |
1130 |
/** This action is documented in wp-admin/includes/meta-boxes.php */ |
|
1131 |
do_action( 'post_submitbox_start', null ); |
|
1132 |
?> |
|
0 | 1133 |
<div id="delete-action"> |
9 | 1134 |
<?php |
16 | 1135 |
if ( ! empty( $_GET['action'] ) && 'edit' === $_GET['action'] && current_user_can( 'manage_links' ) ) { |
1136 |
printf( |
|
1137 |
'<a class="submitdelete deletion" href="%s" onclick="return confirm( \'%s\' );">%s</a>', |
|
1138 |
wp_nonce_url( "link.php?action=delete&link_id=$link->link_id", 'delete-bookmark_' . $link->link_id ), |
|
1139 |
/* translators: %s: Link name. */ |
|
1140 |
esc_js( sprintf( __( "You are about to delete this link '%s'\n 'Cancel' to stop, 'OK' to delete." ), $link->link_name ) ), |
|
1141 |
__( 'Delete' ) |
|
1142 |
); |
|
1143 |
} |
|
1144 |
?> |
|
0 | 1145 |
</div> |
1146 |
||
1147 |
<div id="publishing-action"> |
|
9 | 1148 |
<?php if ( ! empty( $link->link_id ) ) { ?> |
1149 |
<input name="save" type="submit" class="button button-primary button-large" id="publish" value="<?php esc_attr_e( 'Update Link' ); ?>" /> |
|
0 | 1150 |
<?php } else { ?> |
9 | 1151 |
<input name="save" type="submit" class="button button-primary button-large" id="publish" value="<?php esc_attr_e( 'Add Link' ); ?>" /> |
0 | 1152 |
<?php } ?> |
1153 |
</div> |
|
1154 |
<div class="clear"></div> |
|
1155 |
</div> |
|
9 | 1156 |
<?php |
1157 |
/** |
|
1158 |
* Fires at the end of the Publish box in the Link editing screen. |
|
1159 |
* |
|
1160 |
* @since 2.5.0 |
|
1161 |
*/ |
|
1162 |
do_action( 'submitlink_box' ); |
|
1163 |
?> |
|
0 | 1164 |
<div class="clear"></div> |
1165 |
</div> |
|
9 | 1166 |
<?php |
0 | 1167 |
} |
1168 |
||
1169 |
/** |
|
19 | 1170 |
* Displays link categories form fields. |
0 | 1171 |
* |
1172 |
* @since 2.6.0 |
|
1173 |
* |
|
19 | 1174 |
* @param object $link Current link object. |
0 | 1175 |
*/ |
9 | 1176 |
function link_categories_meta_box( $link ) { |
1177 |
?> |
|
0 | 1178 |
<div id="taxonomy-linkcategory" class="categorydiv"> |
1179 |
<ul id="category-tabs" class="category-tabs"> |
|
16 | 1180 |
<li class="tabs"><a href="#categories-all"><?php _e( 'All categories' ); ?></a></li> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1181 |
<li class="hide-if-no-js"><a href="#categories-pop"><?php _ex( 'Most Used', 'categories' ); ?></a></li> |
0 | 1182 |
</ul> |
1183 |
||
1184 |
<div id="categories-all" class="tabs-panel"> |
|
1185 |
<ul id="categorychecklist" data-wp-lists="list:category" class="categorychecklist form-no-clear"> |
|
1186 |
<?php |
|
9 | 1187 |
if ( isset( $link->link_id ) ) { |
1188 |
wp_link_category_checklist( $link->link_id ); |
|
1189 |
} else { |
|
0 | 1190 |
wp_link_category_checklist(); |
9 | 1191 |
} |
0 | 1192 |
?> |
1193 |
</ul> |
|
1194 |
</div> |
|
1195 |
||
1196 |
<div id="categories-pop" class="tabs-panel" style="display: none;"> |
|
1197 |
<ul id="categorychecklist-pop" class="categorychecklist form-no-clear"> |
|
9 | 1198 |
<?php wp_popular_terms_checklist( 'link_category' ); ?> |
0 | 1199 |
</ul> |
1200 |
</div> |
|
1201 |
||
1202 |
<div id="category-adder" class="wp-hidden-children"> |
|
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1203 |
<a id="category-add-toggle" href="#category-add" class="taxonomy-add-new"><?php _e( '+ Add Category' ); ?></a> |
0 | 1204 |
<p id="link-category-add" class="wp-hidden-child"> |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1205 |
<label class="screen-reader-text" for="newcat"> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1206 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1207 |
/* translators: Hidden accessibility text. */ |
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1208 |
_e( '+ Add Category' ); |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1209 |
?> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1210 |
</label> |
0 | 1211 |
<input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php esc_attr_e( 'New category name' ); ?>" aria-required="true" /> |
1212 |
<input type="button" id="link-category-add-submit" data-wp-lists="add:categorychecklist:link-category-add" class="button" value="<?php esc_attr_e( 'Add' ); ?>" /> |
|
1213 |
<?php wp_nonce_field( 'add-link-category', '_ajax_nonce', false ); ?> |
|
1214 |
<span id="category-ajax-response"></span> |
|
1215 |
</p> |
|
1216 |
</div> |
|
1217 |
</div> |
|
9 | 1218 |
<?php |
0 | 1219 |
} |
1220 |
||
1221 |
/** |
|
19 | 1222 |
* Displays form fields for changing link target. |
0 | 1223 |
* |
1224 |
* @since 2.6.0 |
|
1225 |
* |
|
19 | 1226 |
* @param object $link Current link object. |
0 | 1227 |
*/ |
9 | 1228 |
function link_target_meta_box( $link ) { |
1229 |
||
1230 |
?> |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1231 |
<fieldset><legend class="screen-reader-text"><span> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1232 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1233 |
/* translators: Hidden accessibility text. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1234 |
_e( 'Target' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1235 |
?> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1236 |
</span></legend> |
0 | 1237 |
<p><label for="link_target_blank" class="selectit"> |
16 | 1238 |
<input id="link_target_blank" type="radio" name="link_target" value="_blank" <?php echo ( isset( $link->link_target ) && ( '_blank' === $link->link_target ) ? 'checked="checked"' : '' ); ?> /> |
9 | 1239 |
<?php _e( '<code>_blank</code> — new window or tab.' ); ?></label></p> |
0 | 1240 |
<p><label for="link_target_top" class="selectit"> |
16 | 1241 |
<input id="link_target_top" type="radio" name="link_target" value="_top" <?php echo ( isset( $link->link_target ) && ( '_top' === $link->link_target ) ? 'checked="checked"' : '' ); ?> /> |
9 | 1242 |
<?php _e( '<code>_top</code> — current window or tab, with no frames.' ); ?></label></p> |
0 | 1243 |
<p><label for="link_target_none" class="selectit"> |
16 | 1244 |
<input id="link_target_none" type="radio" name="link_target" value="" <?php echo ( isset( $link->link_target ) && ( '' === $link->link_target ) ? 'checked="checked"' : '' ); ?> /> |
9 | 1245 |
<?php _e( '<code>_none</code> — same window or tab.' ); ?></label></p> |
0 | 1246 |
</fieldset> |
9 | 1247 |
<p><?php _e( 'Choose the target frame for your link.' ); ?></p> |
1248 |
<?php |
|
0 | 1249 |
} |
1250 |
||
1251 |
/** |
|
19 | 1252 |
* Displays 'checked' checkboxes attribute for XFN microformat options. |
0 | 1253 |
* |
1254 |
* @since 1.0.1 |
|
1255 |
* |
|
19 | 1256 |
* @global object $link Current link object. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1257 |
* |
19 | 1258 |
* @param string $xfn_relationship XFN relationship category. Possible values are: |
1259 |
* 'friendship', 'physical', 'professional', |
|
1260 |
* 'geographical', 'family', 'romantic', 'identity'. |
|
1261 |
* @param string $xfn_value Optional. The XFN value to mark as checked |
|
1262 |
* if it matches the current link's relationship. |
|
1263 |
* Default empty string. |
|
1264 |
* @param mixed $deprecated Deprecated. Not used. |
|
0 | 1265 |
*/ |
19 | 1266 |
function xfn_check( $xfn_relationship, $xfn_value = '', $deprecated = '' ) { |
0 | 1267 |
global $link; |
1268 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1269 |
if ( ! empty( $deprecated ) ) { |
16 | 1270 |
_deprecated_argument( __FUNCTION__, '2.5.0' ); // Never implemented. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1271 |
} |
0 | 1272 |
|
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
1273 |
$link_rel = isset( $link->link_rel ) ? $link->link_rel : ''; |
19 | 1274 |
$link_rels = preg_split( '/\s+/', $link_rel ); |
0 | 1275 |
|
19 | 1276 |
// Mark the specified value as checked if it matches the current link's relationship. |
1277 |
if ( '' !== $xfn_value && in_array( $xfn_value, $link_rels, true ) ) { |
|
0 | 1278 |
echo ' checked="checked"'; |
1279 |
} |
|
1280 |
||
19 | 1281 |
if ( '' === $xfn_value ) { |
1282 |
// Mark the 'none' value as checked if the current link does not match the specified relationship. |
|
1283 |
if ( 'family' === $xfn_relationship |
|
1284 |
&& ! array_intersect( $link_rels, array( 'child', 'parent', 'sibling', 'spouse', 'kin' ) ) |
|
1285 |
) { |
|
9 | 1286 |
echo ' checked="checked"'; |
1287 |
} |
|
19 | 1288 |
|
1289 |
if ( 'friendship' === $xfn_relationship |
|
1290 |
&& ! array_intersect( $link_rels, array( 'friend', 'acquaintance', 'contact' ) ) |
|
1291 |
) { |
|
9 | 1292 |
echo ' checked="checked"'; |
1293 |
} |
|
19 | 1294 |
|
1295 |
if ( 'geographical' === $xfn_relationship |
|
1296 |
&& ! array_intersect( $link_rels, array( 'co-resident', 'neighbor' ) ) |
|
1297 |
) { |
|
9 | 1298 |
echo ' checked="checked"'; |
1299 |
} |
|
19 | 1300 |
|
1301 |
// Mark the 'me' value as checked if it matches the current link's relationship. |
|
1302 |
if ( 'identity' === $xfn_relationship |
|
1303 |
&& in_array( 'me', $link_rels, true ) |
|
1304 |
) { |
|
9 | 1305 |
echo ' checked="checked"'; |
1306 |
} |
|
0 | 1307 |
} |
1308 |
} |
|
1309 |
||
1310 |
/** |
|
19 | 1311 |
* Displays XFN form fields. |
0 | 1312 |
* |
1313 |
* @since 2.6.0 |
|
1314 |
* |
|
19 | 1315 |
* @param object $link Current link object. |
0 | 1316 |
*/ |
9 | 1317 |
function link_xfn_meta_box( $link ) { |
1318 |
?> |
|
5 | 1319 |
<table class="links-table"> |
0 | 1320 |
<tr> |
16 | 1321 |
<th scope="row"><label for="link_rel"><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'rel:' ); ?></label></th> |
9 | 1322 |
<td><input type="text" name="link_rel" id="link_rel" value="<?php echo ( isset( $link->link_rel ) ? esc_attr( $link->link_rel ) : '' ); ?>" /></td> |
0 | 1323 |
</tr> |
1324 |
<tr> |
|
16 | 1325 |
<th scope="row"><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'identity' ); ?></th> |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1326 |
<td><fieldset> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1327 |
<legend class="screen-reader-text"><span> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1328 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1329 |
/* translators: Hidden accessibility text. xfn: https://gmpg.org/xfn/ */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1330 |
_e( 'identity' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1331 |
?> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1332 |
</span></legend> |
0 | 1333 |
<label for="me"> |
9 | 1334 |
<input type="checkbox" name="identity" value="me" id="me" <?php xfn_check( 'identity', 'me' ); ?> /> |
1335 |
<?php _e( 'another web address of mine' ); ?></label> |
|
0 | 1336 |
</fieldset></td> |
1337 |
</tr> |
|
1338 |
<tr> |
|
16 | 1339 |
<th scope="row"><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'friendship' ); ?></th> |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1340 |
<td><fieldset> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1341 |
<legend class="screen-reader-text"><span> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1342 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1343 |
/* translators: Hidden accessibility text. xfn: https://gmpg.org/xfn/ */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1344 |
_e( 'friendship' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1345 |
?> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1346 |
</span></legend> |
0 | 1347 |
<label for="contact"> |
16 | 1348 |
<input class="valinp" type="radio" name="friendship" value="contact" id="contact" <?php xfn_check( 'friendship', 'contact' ); ?> /> <?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'contact' ); ?> |
0 | 1349 |
</label> |
1350 |
<label for="acquaintance"> |
|
16 | 1351 |
<input class="valinp" type="radio" name="friendship" value="acquaintance" id="acquaintance" <?php xfn_check( 'friendship', 'acquaintance' ); ?> /> <?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'acquaintance' ); ?> |
0 | 1352 |
</label> |
1353 |
<label for="friend"> |
|
16 | 1354 |
<input class="valinp" type="radio" name="friendship" value="friend" id="friend" <?php xfn_check( 'friendship', 'friend' ); ?> /> <?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'friend' ); ?> |
0 | 1355 |
</label> |
1356 |
<label for="friendship"> |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1357 |
<input name="friendship" type="radio" class="valinp" value="" id="friendship" <?php xfn_check( 'friendship' ); ?> /> <?php /* translators: xfn (friendship relation): http://gmpg.org/xfn/ */ _ex( 'none', 'Type of relation' ); ?> |
0 | 1358 |
</label> |
1359 |
</fieldset></td> |
|
1360 |
</tr> |
|
1361 |
<tr> |
|
16 | 1362 |
<th scope="row"> <?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'physical' ); ?> </th> |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1363 |
<td><fieldset> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1364 |
<legend class="screen-reader-text"><span> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1365 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1366 |
/* translators: Hidden accessibility text. xfn: https://gmpg.org/xfn/ */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1367 |
_e( 'physical' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1368 |
?> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1369 |
</span></legend> |
0 | 1370 |
<label for="met"> |
16 | 1371 |
<input class="valinp" type="checkbox" name="physical" value="met" id="met" <?php xfn_check( 'physical', 'met' ); ?> /> <?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'met' ); ?> |
0 | 1372 |
</label> |
1373 |
</fieldset></td> |
|
1374 |
</tr> |
|
1375 |
<tr> |
|
16 | 1376 |
<th scope="row"> <?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'professional' ); ?> </th> |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1377 |
<td><fieldset> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1378 |
<legend class="screen-reader-text"><span> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1379 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1380 |
/* translators: Hidden accessibility text. xfn: https://gmpg.org/xfn/ */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1381 |
_e( 'professional' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1382 |
?> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1383 |
</span></legend> |
0 | 1384 |
<label for="co-worker"> |
16 | 1385 |
<input class="valinp" type="checkbox" name="professional" value="co-worker" id="co-worker" <?php xfn_check( 'professional', 'co-worker' ); ?> /> <?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'co-worker' ); ?> |
0 | 1386 |
</label> |
1387 |
<label for="colleague"> |
|
16 | 1388 |
<input class="valinp" type="checkbox" name="professional" value="colleague" id="colleague" <?php xfn_check( 'professional', 'colleague' ); ?> /> <?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'colleague' ); ?> |
0 | 1389 |
</label> |
1390 |
</fieldset></td> |
|
1391 |
</tr> |
|
1392 |
<tr> |
|
16 | 1393 |
<th scope="row"><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'geographical' ); ?></th> |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1394 |
<td><fieldset> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1395 |
<legend class="screen-reader-text"><span> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1396 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1397 |
/* translators: Hidden accessibility text. xfn: https://gmpg.org/xfn/ */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1398 |
_e( 'geographical' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1399 |
?> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1400 |
</span></legend> |
0 | 1401 |
<label for="co-resident"> |
16 | 1402 |
<input class="valinp" type="radio" name="geographical" value="co-resident" id="co-resident" <?php xfn_check( 'geographical', 'co-resident' ); ?> /> <?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'co-resident' ); ?> |
0 | 1403 |
</label> |
1404 |
<label for="neighbor"> |
|
16 | 1405 |
<input class="valinp" type="radio" name="geographical" value="neighbor" id="neighbor" <?php xfn_check( 'geographical', 'neighbor' ); ?> /> <?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'neighbor' ); ?> |
0 | 1406 |
</label> |
1407 |
<label for="geographical"> |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1408 |
<input class="valinp" type="radio" name="geographical" value="" id="geographical" <?php xfn_check( 'geographical' ); ?> /> <?php /* translators: xfn (geographical relation): http://gmpg.org/xfn/ */ _ex( 'none', 'Type of relation' ); ?> |
0 | 1409 |
</label> |
1410 |
</fieldset></td> |
|
1411 |
</tr> |
|
1412 |
<tr> |
|
16 | 1413 |
<th scope="row"><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'family' ); ?></th> |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1414 |
<td><fieldset> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1415 |
<legend class="screen-reader-text"><span> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1416 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1417 |
/* translators: Hidden accessibility text. xfn: https://gmpg.org/xfn/ */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1418 |
_e( 'family' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1419 |
?> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1420 |
</span></legend> |
0 | 1421 |
<label for="child"> |
16 | 1422 |
<input class="valinp" type="radio" name="family" value="child" id="child" <?php xfn_check( 'family', 'child' ); ?> /> <?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'child' ); ?> |
0 | 1423 |
</label> |
1424 |
<label for="kin"> |
|
16 | 1425 |
<input class="valinp" type="radio" name="family" value="kin" id="kin" <?php xfn_check( 'family', 'kin' ); ?> /> <?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'kin' ); ?> |
0 | 1426 |
</label> |
1427 |
<label for="parent"> |
|
16 | 1428 |
<input class="valinp" type="radio" name="family" value="parent" id="parent" <?php xfn_check( 'family', 'parent' ); ?> /> <?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'parent' ); ?> |
0 | 1429 |
</label> |
1430 |
<label for="sibling"> |
|
16 | 1431 |
<input class="valinp" type="radio" name="family" value="sibling" id="sibling" <?php xfn_check( 'family', 'sibling' ); ?> /> <?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'sibling' ); ?> |
0 | 1432 |
</label> |
1433 |
<label for="spouse"> |
|
16 | 1434 |
<input class="valinp" type="radio" name="family" value="spouse" id="spouse" <?php xfn_check( 'family', 'spouse' ); ?> /> <?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'spouse' ); ?> |
0 | 1435 |
</label> |
1436 |
<label for="family"> |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1437 |
<input class="valinp" type="radio" name="family" value="" id="family" <?php xfn_check( 'family' ); ?> /> <?php /* translators: xfn (family relation): http://gmpg.org/xfn/ */ _ex( 'none', 'Type of relation' ); ?> |
0 | 1438 |
</label> |
1439 |
</fieldset></td> |
|
1440 |
</tr> |
|
1441 |
<tr> |
|
16 | 1442 |
<th scope="row"><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'romantic' ); ?></th> |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1443 |
<td><fieldset> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1444 |
<legend class="screen-reader-text"><span> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1445 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1446 |
/* translators: Hidden accessibility text. xfn: https://gmpg.org/xfn/ */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1447 |
_e( 'romantic' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1448 |
?> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1449 |
</span></legend> |
0 | 1450 |
<label for="muse"> |
16 | 1451 |
<input class="valinp" type="checkbox" name="romantic" value="muse" id="muse" <?php xfn_check( 'romantic', 'muse' ); ?> /> <?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'muse' ); ?> |
0 | 1452 |
</label> |
1453 |
<label for="crush"> |
|
16 | 1454 |
<input class="valinp" type="checkbox" name="romantic" value="crush" id="crush" <?php xfn_check( 'romantic', 'crush' ); ?> /> <?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'crush' ); ?> |
0 | 1455 |
</label> |
1456 |
<label for="date"> |
|
16 | 1457 |
<input class="valinp" type="checkbox" name="romantic" value="date" id="date" <?php xfn_check( 'romantic', 'date' ); ?> /> <?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'date' ); ?> |
0 | 1458 |
</label> |
1459 |
<label for="romantic"> |
|
16 | 1460 |
<input class="valinp" type="checkbox" name="romantic" value="sweetheart" id="romantic" <?php xfn_check( 'romantic', 'sweetheart' ); ?> /> <?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'sweetheart' ); ?> |
0 | 1461 |
</label> |
1462 |
</fieldset></td> |
|
1463 |
</tr> |
|
1464 |
||
1465 |
</table> |
|
16 | 1466 |
<p><?php _e( 'If the link is to a person, you can specify your relationship with them using the above form. If you would like to learn more about the idea check out <a href="https://gmpg.org/xfn/">XFN</a>.' ); ?></p> |
9 | 1467 |
<?php |
0 | 1468 |
} |
1469 |
||
1470 |
/** |
|
19 | 1471 |
* Displays advanced link options form fields. |
0 | 1472 |
* |
1473 |
* @since 2.6.0 |
|
1474 |
* |
|
19 | 1475 |
* @param object $link Current link object. |
0 | 1476 |
*/ |
9 | 1477 |
function link_advanced_meta_box( $link ) { |
1478 |
?> |
|
0 | 1479 |
<table class="links-table" cellpadding="0"> |
1480 |
<tr> |
|
9 | 1481 |
<th scope="row"><label for="link_image"><?php _e( 'Image Address' ); ?></label></th> |
1482 |
<td><input type="text" name="link_image" class="code" id="link_image" maxlength="255" value="<?php echo ( isset( $link->link_image ) ? esc_attr( $link->link_image ) : '' ); ?>" /></td> |
|
0 | 1483 |
</tr> |
1484 |
<tr> |
|
9 | 1485 |
<th scope="row"><label for="rss_uri"><?php _e( 'RSS Address' ); ?></label></th> |
1486 |
<td><input name="link_rss" class="code" type="text" id="rss_uri" maxlength="255" value="<?php echo ( isset( $link->link_rss ) ? esc_attr( $link->link_rss ) : '' ); ?>" /></td> |
|
0 | 1487 |
</tr> |
1488 |
<tr> |
|
9 | 1489 |
<th scope="row"><label for="link_notes"><?php _e( 'Notes' ); ?></label></th> |
1490 |
<td><textarea name="link_notes" id="link_notes" rows="10"><?php echo ( isset( $link->link_notes ) ? $link->link_notes : '' ); // textarea_escaped ?></textarea></td> |
|
0 | 1491 |
</tr> |
1492 |
<tr> |
|
9 | 1493 |
<th scope="row"><label for="link_rating"><?php _e( 'Rating' ); ?></label></th> |
0 | 1494 |
<td><select name="link_rating" id="link_rating" size="1"> |
1495 |
<?php |
|
19 | 1496 |
for ( $rating = 0; $rating <= 10; $rating++ ) { |
1497 |
echo '<option value="' . $rating . '"'; |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1498 |
if ( isset( $link->link_rating ) && $link->link_rating === $rating ) { |
9 | 1499 |
echo ' selected="selected"'; |
0 | 1500 |
} |
19 | 1501 |
echo '>' . $rating . '</option>'; |
9 | 1502 |
} |
1503 |
?> |
|
1504 |
</select> <?php _e( '(Leave at 0 for no rating.)' ); ?> |
|
0 | 1505 |
</td> |
1506 |
</tr> |
|
1507 |
</table> |
|
9 | 1508 |
<?php |
0 | 1509 |
} |
1510 |
||
1511 |
/** |
|
19 | 1512 |
* Displays post thumbnail meta box. |
0 | 1513 |
* |
1514 |
* @since 2.9.0 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1515 |
* |
19 | 1516 |
* @param WP_Post $post Current post object. |
0 | 1517 |
*/ |
1518 |
function post_thumbnail_meta_box( $post ) { |
|
1519 |
$thumbnail_id = get_post_meta( $post->ID, '_thumbnail_id', true ); |
|
1520 |
echo _wp_post_thumbnail_html( $thumbnail_id, $post->ID ); |
|
1521 |
} |
|
5 | 1522 |
|
1523 |
/** |
|
19 | 1524 |
* Displays fields for ID3 data. |
5 | 1525 |
* |
1526 |
* @since 3.9.0 |
|
1527 |
* |
|
19 | 1528 |
* @param WP_Post $post Current post object. |
5 | 1529 |
*/ |
1530 |
function attachment_id3_data_meta_box( $post ) { |
|
1531 |
$meta = array(); |
|
1532 |
if ( ! empty( $post->ID ) ) { |
|
1533 |
$meta = wp_get_attachment_metadata( $post->ID ); |
|
1534 |
} |
|
1535 |
||
9 | 1536 |
foreach ( wp_get_attachment_id3_keys( $post, 'edit' ) as $key => $label ) : |
1537 |
$value = ''; |
|
1538 |
if ( ! empty( $meta[ $key ] ) ) { |
|
1539 |
$value = $meta[ $key ]; |
|
1540 |
} |
|
1541 |
?> |
|
5 | 1542 |
<p> |
9 | 1543 |
<label for="title"><?php echo $label; ?></label><br /> |
1544 |
<input type="text" name="id3_<?php echo esc_attr( $key ); ?>" id="id3_<?php echo esc_attr( $key ); ?>" class="large-text" value="<?php echo esc_attr( $value ); ?>" /> |
|
5 | 1545 |
</p> |
9 | 1546 |
<?php |
5 | 1547 |
endforeach; |
1548 |
} |
|
9 | 1549 |
|
1550 |
/** |
|
1551 |
* Registers the default post meta boxes, and runs the `do_meta_boxes` actions. |
|
1552 |
* |
|
1553 |
* @since 5.0.0 |
|
1554 |
* |
|
1555 |
* @param WP_Post $post The post object that these meta boxes are being generated for. |
|
1556 |
*/ |
|
1557 |
function register_and_do_post_meta_boxes( $post ) { |
|
1558 |
$post_type = $post->post_type; |
|
1559 |
$post_type_object = get_post_type_object( $post_type ); |
|
1560 |
||
1561 |
$thumbnail_support = current_theme_supports( 'post-thumbnails', $post_type ) && post_type_supports( $post_type, 'thumbnail' ); |
|
1562 |
if ( ! $thumbnail_support && 'attachment' === $post_type && $post->post_mime_type ) { |
|
1563 |
if ( wp_attachment_is( 'audio', $post ) ) { |
|
1564 |
$thumbnail_support = post_type_supports( 'attachment:audio', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:audio' ); |
|
1565 |
} elseif ( wp_attachment_is( 'video', $post ) ) { |
|
1566 |
$thumbnail_support = post_type_supports( 'attachment:video', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:video' ); |
|
1567 |
} |
|
1568 |
} |
|
1569 |
||
1570 |
$publish_callback_args = array( '__back_compat_meta_box' => true ); |
|
16 | 1571 |
|
1572 |
if ( post_type_supports( $post_type, 'revisions' ) && 'auto-draft' !== $post->post_status ) { |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1573 |
$revisions = wp_get_latest_revision_id_and_total_count( $post->ID ); |
9 | 1574 |
|
1575 |
// We should aim to show the revisions meta box only when there are revisions. |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1576 |
if ( ! is_wp_error( $revisions ) && $revisions['count'] > 1 ) { |
9 | 1577 |
$publish_callback_args = array( |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1578 |
'revisions_count' => $revisions['count'], |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1579 |
'revision_id' => $revisions['latest_id'], |
9 | 1580 |
'__back_compat_meta_box' => true, |
1581 |
); |
|
16 | 1582 |
|
9 | 1583 |
add_meta_box( 'revisionsdiv', __( 'Revisions' ), 'post_revisions_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) ); |
1584 |
} |
|
1585 |
} |
|
1586 |
||
16 | 1587 |
if ( 'attachment' === $post_type ) { |
9 | 1588 |
wp_enqueue_script( 'image-edit' ); |
1589 |
wp_enqueue_style( 'imgareaselect' ); |
|
1590 |
add_meta_box( 'submitdiv', __( 'Save' ), 'attachment_submit_meta_box', null, 'side', 'core', array( '__back_compat_meta_box' => true ) ); |
|
1591 |
add_action( 'edit_form_after_title', 'edit_form_image_editor' ); |
|
1592 |
||
1593 |
if ( wp_attachment_is( 'audio', $post ) ) { |
|
1594 |
add_meta_box( 'attachment-id3', __( 'Metadata' ), 'attachment_id3_data_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) ); |
|
1595 |
} |
|
1596 |
} else { |
|
1597 |
add_meta_box( 'submitdiv', __( 'Publish' ), 'post_submit_meta_box', null, 'side', 'core', $publish_callback_args ); |
|
1598 |
} |
|
1599 |
||
1600 |
if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post_type, 'post-formats' ) ) { |
|
1601 |
add_meta_box( 'formatdiv', _x( 'Format', 'post format' ), 'post_format_meta_box', null, 'side', 'core', array( '__back_compat_meta_box' => true ) ); |
|
1602 |
} |
|
1603 |
||
16 | 1604 |
// All taxonomies. |
9 | 1605 |
foreach ( get_object_taxonomies( $post ) as $tax_name ) { |
1606 |
$taxonomy = get_taxonomy( $tax_name ); |
|
1607 |
if ( ! $taxonomy->show_ui || false === $taxonomy->meta_box_cb ) { |
|
1608 |
continue; |
|
1609 |
} |
|
1610 |
||
1611 |
$label = $taxonomy->labels->name; |
|
1612 |
||
1613 |
if ( ! is_taxonomy_hierarchical( $tax_name ) ) { |
|
1614 |
$tax_meta_box_id = 'tagsdiv-' . $tax_name; |
|
1615 |
} else { |
|
1616 |
$tax_meta_box_id = $tax_name . 'div'; |
|
1617 |
} |
|
1618 |
||
1619 |
add_meta_box( |
|
1620 |
$tax_meta_box_id, |
|
1621 |
$label, |
|
1622 |
$taxonomy->meta_box_cb, |
|
1623 |
null, |
|
1624 |
'side', |
|
1625 |
'core', |
|
1626 |
array( |
|
1627 |
'taxonomy' => $tax_name, |
|
1628 |
'__back_compat_meta_box' => true, |
|
1629 |
) |
|
1630 |
); |
|
1631 |
} |
|
1632 |
||
1633 |
if ( post_type_supports( $post_type, 'page-attributes' ) || count( get_page_templates( $post ) ) > 0 ) { |
|
1634 |
add_meta_box( 'pageparentdiv', $post_type_object->labels->attributes, 'page_attributes_meta_box', null, 'side', 'core', array( '__back_compat_meta_box' => true ) ); |
|
1635 |
} |
|
1636 |
||
1637 |
if ( $thumbnail_support && current_user_can( 'upload_files' ) ) { |
|
1638 |
add_meta_box( 'postimagediv', esc_html( $post_type_object->labels->featured_image ), 'post_thumbnail_meta_box', null, 'side', 'low', array( '__back_compat_meta_box' => true ) ); |
|
1639 |
} |
|
1640 |
||
1641 |
if ( post_type_supports( $post_type, 'excerpt' ) ) { |
|
1642 |
add_meta_box( 'postexcerpt', __( 'Excerpt' ), 'post_excerpt_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) ); |
|
1643 |
} |
|
1644 |
||
1645 |
if ( post_type_supports( $post_type, 'trackbacks' ) ) { |
|
1646 |
add_meta_box( 'trackbacksdiv', __( 'Send Trackbacks' ), 'post_trackback_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) ); |
|
1647 |
} |
|
1648 |
||
1649 |
if ( post_type_supports( $post_type, 'custom-fields' ) ) { |
|
1650 |
add_meta_box( |
|
1651 |
'postcustom', |
|
1652 |
__( 'Custom Fields' ), |
|
1653 |
'post_custom_meta_box', |
|
1654 |
null, |
|
1655 |
'normal', |
|
1656 |
'core', |
|
1657 |
array( |
|
1658 |
'__back_compat_meta_box' => ! (bool) get_user_meta( get_current_user_id(), 'enable_custom_fields', true ), |
|
1659 |
'__block_editor_compatible_meta_box' => true, |
|
1660 |
) |
|
1661 |
); |
|
1662 |
} |
|
1663 |
||
1664 |
/** |
|
1665 |
* Fires in the middle of built-in meta box registration. |
|
1666 |
* |
|
1667 |
* @since 2.1.0 |
|
16 | 1668 |
* @deprecated 3.7.0 Use {@see 'add_meta_boxes'} instead. |
9 | 1669 |
* |
1670 |
* @param WP_Post $post Post object. |
|
1671 |
*/ |
|
16 | 1672 |
do_action_deprecated( 'dbx_post_advanced', array( $post ), '3.7.0', 'add_meta_boxes' ); |
9 | 1673 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1674 |
/* |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1675 |
* Allow the Discussion meta box to show up if the post type supports comments, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1676 |
* or if comments or pings are open. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1677 |
*/ |
9 | 1678 |
if ( comments_open( $post ) || pings_open( $post ) || post_type_supports( $post_type, 'comments' ) ) { |
1679 |
add_meta_box( 'commentstatusdiv', __( 'Discussion' ), 'post_comment_status_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) ); |
|
1680 |
} |
|
1681 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1682 |
$statuses = get_post_stati( array( 'public' => true ) ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1683 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1684 |
if ( empty( $statuses ) ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1685 |
$statuses = array( 'publish' ); |
9 | 1686 |
} |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1687 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1688 |
$statuses[] = 'private'; |
9 | 1689 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1690 |
if ( in_array( get_post_status( $post ), $statuses, true ) ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1691 |
/* |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1692 |
* If the post type support comments, or the post has comments, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1693 |
* allow the Comments meta box. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1694 |
*/ |
9 | 1695 |
if ( comments_open( $post ) || pings_open( $post ) || $post->comment_count > 0 || post_type_supports( $post_type, 'comments' ) ) { |
1696 |
add_meta_box( 'commentsdiv', __( 'Comments' ), 'post_comment_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) ); |
|
1697 |
} |
|
1698 |
} |
|
1699 |
||
16 | 1700 |
if ( ! ( 'pending' === get_post_status( $post ) && ! current_user_can( $post_type_object->cap->publish_posts ) ) ) { |
9 | 1701 |
add_meta_box( 'slugdiv', __( 'Slug' ), 'post_slug_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) ); |
1702 |
} |
|
1703 |
||
1704 |
if ( post_type_supports( $post_type, 'author' ) && current_user_can( $post_type_object->cap->edit_others_posts ) ) { |
|
1705 |
add_meta_box( 'authordiv', __( 'Author' ), 'post_author_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) ); |
|
1706 |
} |
|
1707 |
||
1708 |
/** |
|
1709 |
* Fires after all built-in meta boxes have been added. |
|
1710 |
* |
|
1711 |
* @since 3.0.0 |
|
1712 |
* |
|
1713 |
* @param string $post_type Post type. |
|
1714 |
* @param WP_Post $post Post object. |
|
1715 |
*/ |
|
1716 |
do_action( 'add_meta_boxes', $post_type, $post ); |
|
1717 |
||
1718 |
/** |
|
1719 |
* Fires after all built-in meta boxes have been added, contextually for the given post type. |
|
1720 |
* |
|
19 | 1721 |
* The dynamic portion of the hook name, `$post_type`, refers to the post type of the post. |
1722 |
* |
|
1723 |
* Possible hook names include: |
|
1724 |
* |
|
1725 |
* - `add_meta_boxes_post` |
|
1726 |
* - `add_meta_boxes_page` |
|
1727 |
* - `add_meta_boxes_attachment` |
|
9 | 1728 |
* |
1729 |
* @since 3.0.0 |
|
1730 |
* |
|
1731 |
* @param WP_Post $post Post object. |
|
1732 |
*/ |
|
1733 |
do_action( "add_meta_boxes_{$post_type}", $post ); |
|
1734 |
||
1735 |
/** |
|
1736 |
* Fires after meta boxes have been added. |
|
1737 |
* |
|
1738 |
* Fires once for each of the default meta box contexts: normal, advanced, and side. |
|
1739 |
* |
|
1740 |
* @since 3.0.0 |
|
1741 |
* |
|
16 | 1742 |
* @param string $post_type Post type of the post on Edit Post screen, 'link' on Edit Link screen, |
1743 |
* 'dashboard' on Dashboard screen. |
|
1744 |
* @param string $context Meta box context. Possible values include 'normal', 'advanced', 'side'. |
|
1745 |
* @param WP_Post|object|string $post Post object on Edit Post screen, link object on Edit Link screen, |
|
1746 |
* an empty string on Dashboard screen. |
|
9 | 1747 |
*/ |
1748 |
do_action( 'do_meta_boxes', $post_type, 'normal', $post ); |
|
1749 |
/** This action is documented in wp-admin/includes/meta-boxes.php */ |
|
1750 |
do_action( 'do_meta_boxes', $post_type, 'advanced', $post ); |
|
1751 |
/** This action is documented in wp-admin/includes/meta-boxes.php */ |
|
1752 |
do_action( 'do_meta_boxes', $post_type, 'side', $post ); |
|
1753 |
} |