130 $private_style = ''; |
130 $private_style = ''; |
131 if ( 'private' === $post->post_status ) { |
131 if ( 'private' === $post->post_status ) { |
132 $private_style = 'style="display:none"'; |
132 $private_style = 'style="display:none"'; |
133 } |
133 } |
134 ?> |
134 ?> |
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"><?php _e( 'Edit status' ); ?></span></a> |
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"> |
|
136 <?php |
|
137 /* translators: Hidden accessibility text. */ |
|
138 _e( 'Edit status' ); |
|
139 ?> |
|
140 </span></a> |
136 |
141 |
137 <div id="post-status-select" class="hide-if-js"> |
142 <div id="post-status-select" class="hide-if-js"> |
138 <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 ); ?>" /> |
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 ); ?>" /> |
139 <label for="post_status" class="screen-reader-text"><?php _e( 'Set status' ); ?></label> |
144 <label for="post_status" class="screen-reader-text"> |
|
145 <?php |
|
146 /* translators: Hidden accessibility text. */ |
|
147 _e( 'Set status' ); |
|
148 ?> |
|
149 </label> |
140 <select name="post_status" id="post_status"> |
150 <select name="post_status" id="post_status"> |
141 <?php if ( 'publish' === $post->post_status ) : ?> |
151 <?php if ( 'publish' === $post->post_status ) : ?> |
142 <option<?php selected( $post->post_status, 'publish' ); ?> value='publish'><?php _e( 'Published' ); ?></option> |
152 <option<?php selected( $post->post_status, 'publish' ); ?> value='publish'><?php _e( 'Published' ); ?></option> |
143 <?php elseif ( 'private' === $post->post_status ) : ?> |
153 <?php elseif ( 'private' === $post->post_status ) : ?> |
144 <option<?php selected( $post->post_status, 'private' ); ?> value='publish'><?php _e( 'Privately Published' ); ?></option> |
154 <option<?php selected( $post->post_status, 'private' ); ?> value='publish'><?php _e( 'Privately Published' ); ?></option> |
268 <span id="timestamp"> |
288 <span id="timestamp"> |
269 <?php printf( $stamp, '<b>' . $date . '</b>' ); ?> |
289 <?php printf( $stamp, '<b>' . $date . '</b>' ); ?> |
270 </span> |
290 </span> |
271 <a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" role="button"> |
291 <a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" role="button"> |
272 <span aria-hidden="true"><?php _e( 'Edit' ); ?></span> |
292 <span aria-hidden="true"><?php _e( 'Edit' ); ?></span> |
273 <span class="screen-reader-text"><?php _e( 'Edit date and time' ); ?></span> |
293 <span class="screen-reader-text"> |
|
294 <?php |
|
295 /* translators: Hidden accessibility text. */ |
|
296 _e( 'Edit date and time' ); |
|
297 ?> |
|
298 </span> |
274 </a> |
299 </a> |
275 <fieldset id="timestampdiv" class="hide-if-js"> |
300 <fieldset id="timestampdiv" class="hide-if-js"> |
276 <legend class="screen-reader-text"><?php _e( 'Date and time' ); ?></legend> |
301 <legend class="screen-reader-text"> |
|
302 <?php |
|
303 /* translators: Hidden accessibility text. */ |
|
304 _e( 'Date and time' ); |
|
305 ?> |
|
306 </legend> |
277 <?php touch_time( ( 'edit' === $action ), 1 ); ?> |
307 <?php touch_time( ( 'edit' === $action ), 1 ); ?> |
278 </fieldset> |
308 </fieldset> |
279 </div> |
309 </div> |
280 <?php |
310 <?php |
281 endif; |
311 endif; |
282 |
312 |
283 if ( 'draft' === $post->post_status && get_post_meta( $post_id, '_customize_changeset_uuid', true ) ) : |
313 if ( 'draft' === $post->post_status && get_post_meta( $post_id, '_customize_changeset_uuid', true ) ) : |
284 ?> |
314 $message = sprintf( |
285 <div class="notice notice-info notice-alt inline"> |
315 /* translators: %s: URL to the Customizer. */ |
286 <p> |
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.' ), |
287 <?php |
317 esc_url( |
288 printf( |
318 add_query_arg( |
289 /* translators: %s: URL to the Customizer. */ |
319 'changeset_uuid', |
290 __( '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.' ), |
320 rawurlencode( get_post_meta( $post_id, '_customize_changeset_uuid', true ) ), |
291 esc_url( |
321 admin_url( 'customize.php' ) |
292 add_query_arg( |
322 ) |
293 'changeset_uuid', |
323 ) |
294 rawurlencode( get_post_meta( $post_id, '_customize_changeset_uuid', true ) ), |
324 ); |
295 admin_url( 'customize.php' ) |
325 wp_admin_notice( |
296 ) |
326 $message, |
297 ) |
327 array( |
298 ); |
328 'type' => 'info', |
299 ?> |
329 'additional_classes' => array( 'notice-alt', 'inline' ), |
300 </p> |
330 ) |
301 </div> |
331 ); |
302 <?php |
|
303 endif; |
332 endif; |
304 |
333 |
305 /** |
334 /** |
306 * Fires after the post time/date setting in the Publish meta box. |
335 * Fires after the post time/date setting in the Publish meta box. |
307 * |
336 * |
403 <div id="misc-publishing-actions"> |
432 <div id="misc-publishing-actions"> |
404 <div class="misc-pub-section curtime misc-pub-curtime"> |
433 <div class="misc-pub-section curtime misc-pub-curtime"> |
405 <span id="timestamp"> |
434 <span id="timestamp"> |
406 <?php |
435 <?php |
407 $uploaded_on = sprintf( |
436 $uploaded_on = sprintf( |
408 /* translators: Publish box date string. 1: Date, 2: Time. See https://www.php.net/manual/datetime.format.php */ |
437 /* translators: Publish box date string. 1: Date, 2: Time. */ |
409 __( '%1$s at %2$s' ), |
438 __( '%1$s at %2$s' ), |
410 /* translators: Publish box date format, see https://www.php.net/manual/datetime.format.php */ |
439 /* translators: Publish box date format, see https://www.php.net/manual/datetime.format.php */ |
411 date_i18n( _x( 'M j, Y', 'publish box date format' ), strtotime( $post->post_date ) ), |
440 date_i18n( _x( 'M j, Y', 'publish box date format' ), strtotime( $post->post_date ) ), |
412 /* translators: Publish box time format, see https://www.php.net/manual/datetime.format.php */ |
441 /* translators: Publish box time format, see https://www.php.net/manual/datetime.format.php */ |
413 date_i18n( _x( 'H:i', 'publish box time format' ), strtotime( $post->post_date ) ) |
442 date_i18n( _x( 'H:i', 'publish box time format' ), strtotime( $post->post_date ) ) |
1252 <th scope="row"><label for="link_rel"><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'rel:' ); ?></label></th> |
1321 <th scope="row"><label for="link_rel"><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'rel:' ); ?></label></th> |
1253 <td><input type="text" name="link_rel" id="link_rel" value="<?php echo ( isset( $link->link_rel ) ? esc_attr( $link->link_rel ) : '' ); ?>" /></td> |
1322 <td><input type="text" name="link_rel" id="link_rel" value="<?php echo ( isset( $link->link_rel ) ? esc_attr( $link->link_rel ) : '' ); ?>" /></td> |
1254 </tr> |
1323 </tr> |
1255 <tr> |
1324 <tr> |
1256 <th scope="row"><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'identity' ); ?></th> |
1325 <th scope="row"><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'identity' ); ?></th> |
1257 <td><fieldset><legend class="screen-reader-text"><span><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'identity' ); ?></span></legend> |
1326 <td><fieldset> |
|
1327 <legend class="screen-reader-text"><span> |
|
1328 <?php |
|
1329 /* translators: Hidden accessibility text. xfn: https://gmpg.org/xfn/ */ |
|
1330 _e( 'identity' ); |
|
1331 ?> |
|
1332 </span></legend> |
1258 <label for="me"> |
1333 <label for="me"> |
1259 <input type="checkbox" name="identity" value="me" id="me" <?php xfn_check( 'identity', 'me' ); ?> /> |
1334 <input type="checkbox" name="identity" value="me" id="me" <?php xfn_check( 'identity', 'me' ); ?> /> |
1260 <?php _e( 'another web address of mine' ); ?></label> |
1335 <?php _e( 'another web address of mine' ); ?></label> |
1261 </fieldset></td> |
1336 </fieldset></td> |
1262 </tr> |
1337 </tr> |
1263 <tr> |
1338 <tr> |
1264 <th scope="row"><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'friendship' ); ?></th> |
1339 <th scope="row"><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'friendship' ); ?></th> |
1265 <td><fieldset><legend class="screen-reader-text"><span><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'friendship' ); ?></span></legend> |
1340 <td><fieldset> |
|
1341 <legend class="screen-reader-text"><span> |
|
1342 <?php |
|
1343 /* translators: Hidden accessibility text. xfn: https://gmpg.org/xfn/ */ |
|
1344 _e( 'friendship' ); |
|
1345 ?> |
|
1346 </span></legend> |
1266 <label for="contact"> |
1347 <label for="contact"> |
1267 <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' ); ?> |
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' ); ?> |
1268 </label> |
1349 </label> |
1269 <label for="acquaintance"> |
1350 <label for="acquaintance"> |
1270 <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' ); ?> |
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' ); ?> |
1271 </label> |
1352 </label> |
1272 <label for="friend"> |
1353 <label for="friend"> |
1273 <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' ); ?> |
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' ); ?> |
1274 </label> |
1355 </label> |
1275 <label for="friendship"> |
1356 <label for="friendship"> |
1276 <input name="friendship" type="radio" class="valinp" value="" id="friendship" <?php xfn_check( 'friendship' ); ?> /> <?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'none' ); ?> |
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' ); ?> |
1277 </label> |
1358 </label> |
1278 </fieldset></td> |
1359 </fieldset></td> |
1279 </tr> |
1360 </tr> |
1280 <tr> |
1361 <tr> |
1281 <th scope="row"> <?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'physical' ); ?> </th> |
1362 <th scope="row"> <?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'physical' ); ?> </th> |
1282 <td><fieldset><legend class="screen-reader-text"><span><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'physical' ); ?></span></legend> |
1363 <td><fieldset> |
|
1364 <legend class="screen-reader-text"><span> |
|
1365 <?php |
|
1366 /* translators: Hidden accessibility text. xfn: https://gmpg.org/xfn/ */ |
|
1367 _e( 'physical' ); |
|
1368 ?> |
|
1369 </span></legend> |
1283 <label for="met"> |
1370 <label for="met"> |
1284 <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' ); ?> |
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' ); ?> |
1285 </label> |
1372 </label> |
1286 </fieldset></td> |
1373 </fieldset></td> |
1287 </tr> |
1374 </tr> |
1288 <tr> |
1375 <tr> |
1289 <th scope="row"> <?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'professional' ); ?> </th> |
1376 <th scope="row"> <?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'professional' ); ?> </th> |
1290 <td><fieldset><legend class="screen-reader-text"><span><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'professional' ); ?></span></legend> |
1377 <td><fieldset> |
|
1378 <legend class="screen-reader-text"><span> |
|
1379 <?php |
|
1380 /* translators: Hidden accessibility text. xfn: https://gmpg.org/xfn/ */ |
|
1381 _e( 'professional' ); |
|
1382 ?> |
|
1383 </span></legend> |
1291 <label for="co-worker"> |
1384 <label for="co-worker"> |
1292 <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' ); ?> |
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' ); ?> |
1293 </label> |
1386 </label> |
1294 <label for="colleague"> |
1387 <label for="colleague"> |
1295 <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' ); ?> |
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' ); ?> |
1296 </label> |
1389 </label> |
1297 </fieldset></td> |
1390 </fieldset></td> |
1298 </tr> |
1391 </tr> |
1299 <tr> |
1392 <tr> |
1300 <th scope="row"><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'geographical' ); ?></th> |
1393 <th scope="row"><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'geographical' ); ?></th> |
1301 <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'geographical' ); ?> </span></legend> |
1394 <td><fieldset> |
|
1395 <legend class="screen-reader-text"><span> |
|
1396 <?php |
|
1397 /* translators: Hidden accessibility text. xfn: https://gmpg.org/xfn/ */ |
|
1398 _e( 'geographical' ); |
|
1399 ?> |
|
1400 </span></legend> |
1302 <label for="co-resident"> |
1401 <label for="co-resident"> |
1303 <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' ); ?> |
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' ); ?> |
1304 </label> |
1403 </label> |
1305 <label for="neighbor"> |
1404 <label for="neighbor"> |
1306 <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' ); ?> |
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' ); ?> |
1307 </label> |
1406 </label> |
1308 <label for="geographical"> |
1407 <label for="geographical"> |
1309 <input class="valinp" type="radio" name="geographical" value="" id="geographical" <?php xfn_check( 'geographical' ); ?> /> <?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'none' ); ?> |
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' ); ?> |
1310 </label> |
1409 </label> |
1311 </fieldset></td> |
1410 </fieldset></td> |
1312 </tr> |
1411 </tr> |
1313 <tr> |
1412 <tr> |
1314 <th scope="row"><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'family' ); ?></th> |
1413 <th scope="row"><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'family' ); ?></th> |
1315 <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'family' ); ?> </span></legend> |
1414 <td><fieldset> |
|
1415 <legend class="screen-reader-text"><span> |
|
1416 <?php |
|
1417 /* translators: Hidden accessibility text. xfn: https://gmpg.org/xfn/ */ |
|
1418 _e( 'family' ); |
|
1419 ?> |
|
1420 </span></legend> |
1316 <label for="child"> |
1421 <label for="child"> |
1317 <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' ); ?> |
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' ); ?> |
1318 </label> |
1423 </label> |
1319 <label for="kin"> |
1424 <label for="kin"> |
1320 <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' ); ?> |
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' ); ?> |
1327 </label> |
1432 </label> |
1328 <label for="spouse"> |
1433 <label for="spouse"> |
1329 <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' ); ?> |
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' ); ?> |
1330 </label> |
1435 </label> |
1331 <label for="family"> |
1436 <label for="family"> |
1332 <input class="valinp" type="radio" name="family" value="" id="family" <?php xfn_check( 'family' ); ?> /> <?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'none' ); ?> |
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' ); ?> |
1333 </label> |
1438 </label> |
1334 </fieldset></td> |
1439 </fieldset></td> |
1335 </tr> |
1440 </tr> |
1336 <tr> |
1441 <tr> |
1337 <th scope="row"><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'romantic' ); ?></th> |
1442 <th scope="row"><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'romantic' ); ?></th> |
1338 <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'romantic' ); ?> </span></legend> |
1443 <td><fieldset> |
|
1444 <legend class="screen-reader-text"><span> |
|
1445 <?php |
|
1446 /* translators: Hidden accessibility text. xfn: https://gmpg.org/xfn/ */ |
|
1447 _e( 'romantic' ); |
|
1448 ?> |
|
1449 </span></legend> |
1339 <label for="muse"> |
1450 <label for="muse"> |
1340 <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' ); ?> |
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' ); ?> |
1341 </label> |
1452 </label> |
1342 <label for="crush"> |
1453 <label for="crush"> |
1343 <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' ); ?> |
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' ); ?> |
1457 } |
1568 } |
1458 |
1569 |
1459 $publish_callback_args = array( '__back_compat_meta_box' => true ); |
1570 $publish_callback_args = array( '__back_compat_meta_box' => true ); |
1460 |
1571 |
1461 if ( post_type_supports( $post_type, 'revisions' ) && 'auto-draft' !== $post->post_status ) { |
1572 if ( post_type_supports( $post_type, 'revisions' ) && 'auto-draft' !== $post->post_status ) { |
1462 $revisions = wp_get_post_revisions( $post->ID, array( 'fields' => 'ids' ) ); |
1573 $revisions = wp_get_latest_revision_id_and_total_count( $post->ID ); |
1463 |
1574 |
1464 // We should aim to show the revisions meta box only when there are revisions. |
1575 // We should aim to show the revisions meta box only when there are revisions. |
1465 if ( count( $revisions ) > 1 ) { |
1576 if ( ! is_wp_error( $revisions ) && $revisions['count'] > 1 ) { |
1466 $publish_callback_args = array( |
1577 $publish_callback_args = array( |
1467 'revisions_count' => count( $revisions ), |
1578 'revisions_count' => $revisions['count'], |
1468 'revision_id' => reset( $revisions ), |
1579 'revision_id' => $revisions['latest_id'], |
1469 '__back_compat_meta_box' => true, |
1580 '__back_compat_meta_box' => true, |
1470 ); |
1581 ); |
1471 |
1582 |
1472 add_meta_box( 'revisionsdiv', __( 'Revisions' ), 'post_revisions_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) ); |
1583 add_meta_box( 'revisionsdiv', __( 'Revisions' ), 'post_revisions_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) ); |
1473 } |
1584 } |
1558 * |
1669 * |
1559 * @param WP_Post $post Post object. |
1670 * @param WP_Post $post Post object. |
1560 */ |
1671 */ |
1561 do_action_deprecated( 'dbx_post_advanced', array( $post ), '3.7.0', 'add_meta_boxes' ); |
1672 do_action_deprecated( 'dbx_post_advanced', array( $post ), '3.7.0', 'add_meta_boxes' ); |
1562 |
1673 |
1563 // Allow the Discussion meta box to show up if the post type supports comments, |
1674 /* |
1564 // or if comments or pings are open. |
1675 * Allow the Discussion meta box to show up if the post type supports comments, |
|
1676 * or if comments or pings are open. |
|
1677 */ |
1565 if ( comments_open( $post ) || pings_open( $post ) || post_type_supports( $post_type, 'comments' ) ) { |
1678 if ( comments_open( $post ) || pings_open( $post ) || post_type_supports( $post_type, 'comments' ) ) { |
1566 add_meta_box( 'commentstatusdiv', __( 'Discussion' ), 'post_comment_status_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) ); |
1679 add_meta_box( 'commentstatusdiv', __( 'Discussion' ), 'post_comment_status_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) ); |
1567 } |
1680 } |
1568 |
1681 |
1569 $stati = get_post_stati( array( 'public' => true ) ); |
1682 $statuses = get_post_stati( array( 'public' => true ) ); |
1570 if ( empty( $stati ) ) { |
1683 |
1571 $stati = array( 'publish' ); |
1684 if ( empty( $statuses ) ) { |
1572 } |
1685 $statuses = array( 'publish' ); |
1573 $stati[] = 'private'; |
1686 } |
1574 |
1687 |
1575 if ( in_array( get_post_status( $post ), $stati, true ) ) { |
1688 $statuses[] = 'private'; |
1576 // If the post type support comments, or the post has comments, |
1689 |
1577 // allow the Comments meta box. |
1690 if ( in_array( get_post_status( $post ), $statuses, true ) ) { |
|
1691 /* |
|
1692 * If the post type support comments, or the post has comments, |
|
1693 * allow the Comments meta box. |
|
1694 */ |
1578 if ( comments_open( $post ) || pings_open( $post ) || $post->comment_count > 0 || post_type_supports( $post_type, 'comments' ) ) { |
1695 if ( comments_open( $post ) || pings_open( $post ) || $post->comment_count > 0 || post_type_supports( $post_type, 'comments' ) ) { |
1579 add_meta_box( 'commentsdiv', __( 'Comments' ), 'post_comment_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) ); |
1696 add_meta_box( 'commentsdiv', __( 'Comments' ), 'post_comment_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) ); |
1580 } |
1697 } |
1581 } |
1698 } |
1582 |
1699 |