root/trunk/wp-admin/edit-form-advanced.php

Revision 9119, 23.9 kB (checked in by ryan, 12 hours ago)

phpdoc for wp-admin. Props jacobsantos. see #7527

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 <?php
2 /**
3  * Post advanced form for inclusion in the administration panels.
4  *
5  * @package WordPress
6  * @subpackage Administration
7  */
8
9 /**
10  * Post ID global
11  * @name $post_ID
12  * @var int
13  */
14 if ( ! isset( $post_ID ) )
15     $post_ID = 0;
16 else
17     $post_ID = (int) $post_ID;
18
19 $action = isset($action) ? $action : '';
20 if ( isset($_GET['message']) )
21     $_GET['message'] = absint( $_GET['message'] );
22 $messages[1] = sprintf( __( 'Post updated. Continue editing below or <a href="%s">go back</a>.' ), attribute_escape( stripslashes( ( isset( $_GET['_wp_original_http_referer'] ) ? $_GET['_wp_original_http_referer'] : '') ) ) );
23 $messages[2] = __('Custom field updated.');
24 $messages[3] = __('Custom field deleted.');
25 $messages[4] = __('Post updated.');
26 $messages[6] = __('Post published.');
27 $messages[7] = __('Post saved.');
28
29 if ( isset($_GET['revision']) )
30     $messages[5] = sprintf( __('Post restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) );
31
32 $notice = false;
33 $notices[1] = __( 'There is an autosave of this post that is more recent than the version below.  <a href="%s">View the autosave</a>.' );
34
35 if ( 0 == $post_ID ) {
36     $form_action = 'post';
37     $temp_ID = -1 * time(); // don't change this formula without looking at wp_write_post()
38     $form_extra = "<input type='hidden' id='post_ID' name='temp_ID' value='$temp_ID' />";
39     $autosave = false;
40 } else {
41     $form_action = 'editpost';
42     $form_extra = "<input type='hidden' id='post_ID' name='post_ID' value='$post_ID' />";
43     $autosave = wp_get_post_autosave( $post_ID );
44
45     // Detect if there exists an autosave newer than the post and if that autosave is different than the post
46     if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt ) > mysql2date( 'U', $post->post_modified_gmt ) ) {
47         foreach ( _wp_post_revision_fields() as $autosave_field => $_autosave_field ) {
48             if ( wp_text_diff( $autosave->$autosave_field, $post->$autosave_field ) ) {
49                 $notice = sprintf( $notices[1], get_edit_post_link( $autosave->ID ) );
50                 break;
51             }
52         }
53         unset($autosave_field, $_autosave_field);
54     }
55 }
56
57 // All meta boxes should be defined and added before the first do_meta_boxes() call (or potentially during the do_meta_boxes action).
58
59 /**
60  * Display post submit form fields.
61  *
62  * @since 2.7.0
63  *
64  * @param object $post
65  */
66 function post_submit_meta_box($post) {
67     global $action;
68
69     $can_publish = current_user_can('publish_posts');
70 ?>
71 <div class="submitbox" id="submitpost">
72
73 <div class="inside-submitbox">
74
75 <div class="insidebox"><label for="post_status"><?php _e('This post is') ?></label>
76 <strong><span id="post-status-display">
77 <?php
78 switch ( $post->post_status ) {
79     case 'publish':
80     case 'private':
81         _e('Published');
82         break;
83     case 'future':
84         _e('Scheduled');
85         break;
86     case 'pending':
87         _e('Pending Review');
88         break;
89     case 'draft':
90         _e('Unpublished');
91         break;
92 }
93 ?>
94 </span></strong>
95 <?php if ( 'publish' == $post->post_status || 'private' == $post->post_status ) { ?>
96 <a href="#post_status" class="edit-post-status hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a>
97
98 <div id="post-status-select" class="hide-if-js">
99 <input type="hidden" name="hidden_post_status" id="hidden_post_status" value="<?php echo $post->post_status; ?>" />
100 <?php _e('Change post status'); ?><br />
101 <select name='post_status' id='post_status' tabindex='4'>
102 <?php
103 // only show the publish menu item if they are allowed to publish posts or they are allowed to edit this post (accounts for 'edit_published_posts' capability)
104 if ( $can_publish OR ( $post->post_status == 'publish' AND current_user_can('edit_post', $post->ID) ) ) : ?>
105 <option<?php selected( $post->post_status, 'publish' ); selected( $post->post_status, 'private' );?> value='publish'><?php _e('Published') ?></option>
106 <?php if ( 'future' == $post->post_status ) : ?>
107 <option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e('Scheduled') ?></option>
108 <?php endif; ?>
109 <?php endif; ?>
110 <option<?php selected( $post->post_status, 'pending' ); ?> value='pending'><?php _e('Pending Review') ?></option>
111 <option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e('Unpublished') ?></option>
112 </select>
113
114 <a href="#post_status" class="save-post-status hide-if-no-js button"><?php _e('OK'); ?></a>
115 <a href="#post_status" class="cancel-post-status hide-if-no-js"><?php _e('Cancel'); ?></a>
116 </div>
117 </div>
118
119 <?php } else { ?>
120 </div>
121
122 <?php if ( $can_publish && 'pending' != $post->post_status ) { ?>
123 <div  class="insidebox"><input name="pending" type="submit" class="button" id="pending" tabindex="6" accesskey="r" value="<?php _e('Submit for Review') ?>" /></div>
124 <?php } ?>
125
126 <?php } ?>
127
128 <?php if ( $can_publish && current_user_can( 'edit_others_posts' ) ) { ?>
129     <div class="insidebox" id="sticky-checkbox"><input id="sticky" name="sticky" type="checkbox" value="sticky" <?php checked(is_sticky($post->ID), true); ?> tabindex="4" /> <label for="sticky" class="selectit"><?php _e('Stick this post to the front page') ?></label></div>
130 <?php } ?>
131
132 <?php
133 if ( ( 'edit' == $action ) && current_user_can('delete_post', $post->ID) ) { ?>
134     <div class="insidebox" id="deletebutton"><a class="submitdelete" href="<?php echo wp_nonce_url("post.php?action=delete&amp;post=$post->ID", 'delete-post_' . $post->ID); ?>" onclick="if ( confirm('<?php echo js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n  'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this post '%s'\n  'Cancel' to stop, 'OK' to delete."), $post->post_title )); ?>') ) {return true;}return false;"><?php _e('Delete&nbsp;post'); ?></a></div>
135 <?php } ?>
136
137 <?php
138 if ( 0 != $post->ID ) {
139     if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date
140         $stamp = __('Scheduled for: %1$s at %2$s');
141     } else if ( 'publish' == $post->post_status ) { // already published
142         $stamp = __('Published on: %1$s at %2$s');
143     } else if ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified
144         $stamp = __('Publish immediately');
145     } else { // draft, 1 or more saves, date specified
146         $stamp = __('Publish on: %1$s at %2$s');
147     }
148     $date = mysql2date(get_option('date_format'), $post->post_date);
149     $time = mysql2date(get_option('time_format'), $post->post_date);
150 } else { // draft (no saves, and thus no date specified)
151     $stamp = __('Publish immediately');
152     $date = mysql2date(get_option('date_format'), current_time('mysql'));
153     $time = mysql2date(get_option('time_format'), current_time('mysql'));
154 }
155 ?>
156 <?php if ( $can_publish ) : // Contributors don't get to choose the date of publish ?>
157 <div class="insidebox curtime"><span id="timestamp"><?php printf($stamp, $date, $time); ?></span>
158 &nbsp;<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a>
159
160 <div id="timestampdiv" class="hide-if-js"><?php touch_time(($action == 'edit'),1,4); ?></div></div>
161 <?php endif; ?>
162
163 </div>
164
165 <p class="submit">
166 <?php do_action('post_submitbox_start'); ?>
167 <?php if ( 'publish' == $post->post_status || 'private' == $post->post_status )
168     $savebtn = attribute_escape( __('Save') );
169 else
170     $savebtn = attribute_escape( __('Save Draft') );
171 ?>
172 <input type="submit" name="save" id="save-post" value="<?php echo $savebtn; ?>" tabindex="4" class="button button-highlighted" />
173
174 <?php if ( 'publish' == $post->post_status ) { ?>
175 <a class="preview button" href="<?php echo clean_url(get_permalink($post->ID)); ?>" target="_blank" tabindex="4"><?php _e('View this Post'); ?></a>
176 <?php } else { ?>
177 <a class="preview button" href="<?php echo clean_url(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post->ID)))); ?>" target="_blank" tabindex="4"><?php _e('Preview'); ?></a>
178 <?php } ?>
179
180 <?php
181 if ( !in_array( $post->post_status, array('publish', 'future') ) || 0 == $post->ID ) { ?>
182 <?php if ( current_user_can('publish_posts') ) : ?>
183     <input name="publish" type="submit" class="button" id="publish" tabindex="5" accesskey="p" value="<?php _e('Publish') ?>" />
184 <?php else : ?>
185     <input name="publish" type="submit" class="button" id="publish" tabindex="5" accesskey="p" value="<?php _e('Submit for Review') ?>" />
186 <?php endif; ?>
187 <?php } ?>
188
189 </p>
190 <div class="clear"></div>
191 </div>
192
193 <?php
194 }
195 add_meta_box('submitdiv', __('Publish'), 'post_submit_meta_box', 'post', 'side', 'core');
196
197 /**
198  * Display post tags form fields.
199  *
200  * @since 2.6.0
201  *
202  * @param object $post
203  */
204 function post_tags_meta_box($post) {
205 ?>
206 <p id="jaxtag"><label class="hidden" for="newtag"><?php _e('Tags'); ?></label><input type="text" name="tags_input" class="tags-input" id="tags-input" size="40" tabindex="3" value="<?php echo get_tags_to_edit( $post->ID ); ?>" /></p>
207 <div id="tagchecklist"></div>
208 <p><a href='#'><?php _e( 'Choose from tags' ); ?></a></p>
209 <?php
210 }
211 add_meta_box('tagsdiv', __('Tags'), 'post_tags_meta_box', 'post', 'side', 'core');
212
213 /**
214  * Display add post media and current post media form fields and images.
215  *
216  * @todo Complete.
217  * @since 2.7.0
218  *
219  * @param object $post
220  */
221 function post_media_meta_box($post) {
222     echo "<p><small><em>This feature isn't fully functional in this prototype.</em></small></p>";
223
224     if ( empty( $post->ID ) )
225         return;
226
227     $atts = get_children( array(
228         'post_parent' => $post->ID,
229         'post_type' => 'attachment'
230     ) );
231
232     if ( !$atts ) {
233         _e( 'No media.' );
234         return;
235     }
236
237     foreach ( $atts as $att ) {
238         if ( $thumb = wp_get_attachment_image( $att->ID, array(60, 45), true ) ) {
239 ?>
240             <a href="media.php?action=edit&amp;attachment_id=<?php echo $att->ID  ?>" title="<?php echo attribute_escape(sprintf(__('Edit "%s"'), $att->post_title)); ?>">
241                 <?php echo $thumb; ?>
242             </a>
243
244 <?php
245         }
246         echo "<h4>$att->post_title</h4>";
247
248         echo "<a href='#' class='no-crazy'>Remove</a> | ";
249         echo "<a href='media.php?action=edit&amp;attachment_id=$att->ID'>Edit</a>";
250
251         echo "<br class='clear' />";
252     }
253
254 }
255 add_meta_box( 'mediadiv', __('Media' ), 'post_media_meta_box', 'post', 'side', 'core' );
256
257 /**
258  * Display post categories form fields.
259  *
260  * @since 2.6.0
261  *
262  * @param object $post
263  */
264 function post_categories_meta_box($post) {
265 ?>
266 <ul id="category-tabs">
267     <li class="ui-tabs-selected"><a href="#categories-all" tabindex="3"><?php _e( 'All Categories' ); ?></a></li>
268     <li class="hide-if-no-js"><a href="#categories-pop" tabindex="3"><?php _e( 'Most Used' ); ?></a></li>
269 </ul>
270
271 <div id="categories-pop" class="ui-tabs-panel" style="display: none;">
272     <ul id="categorychecklist-pop" class="categorychecklist form-no-clear" >
273         <?php $popular_ids = wp_popular_terms_checklist('category'); ?>
274     </ul>
275 </div>
276
277 <div id="categories-all" class="ui-tabs-panel">
278     <ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
279         <?php wp_category_checklist($post->ID, false, false, $popular_ids) ?>
280     </ul>
281 </div>
282
283 <div id="category-adder" class="wp-hidden-children">
284     <h4><a id="category-add-toggle" href="#category-add" class="hide-if-no-js" tabindex="3"><?php _e( '+ Add New Category' ); ?></a></h4>
285     <p id="category-add" class="wp-hidden-child">
286         <label class="hidden" for="newcat"><?php _e( 'Add New Category' ); ?></label><input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php _e( 'New category name' ); ?>" tabindex="3" aria-required="true"/>
287         <label class="hidden" for="newcat_parent"><?php _e('Parent category'); ?>:</label><?php wp_dropdown_categories( array( 'hide_empty' => 0, 'name' => 'newcat_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => __('Parent category'), 'tab_index' => 3 ) ); ?>
288         <input type="button" id="category-add-sumbit" class="add:categorychecklist:category-add button" value="<?php _e( 'Add' ); ?>" tabindex="3" />
289         <?php wp_nonce_field( 'add-category', '_ajax_nonce', false ); ?>
290         <span id="category-ajax-response"></span>
291     </p>
292 </div>
293
294 <?php
295 }
296 add_meta_box('categorydiv', __('Categories'), 'post_categories_meta_box', 'post', 'side', 'core');
297
298 /**
299  * Display post excerpt form fields.
300  *
301  * @since 2.6.0
302  *
303  * @param object $post
304  */
305 function post_excerpt_meta_box($post) {
306 ?>
307 <label class="hidden" for="excerpt"><?php _e('Excerpt') ?></label><textarea rows="1" cols="40" name="excerpt" tabindex="6" id="excerpt"><?php echo $post->post_excerpt ?></textarea>
308 <p><?php _e('Excerpts are optional hand-crafted summaries of your content. You can <a href="http://codex.wordpress.org/Template_Tags/the_excerpt" target="_blank">use them in your template</a>'); ?></p>
309 <?php
310 }
311 add_meta_box('postexcerpt', __('Excerpt'), 'post_excerpt_meta_box', 'post', 'normal', 'core');
312
313 /**
314  * Display trackback links form fields.
315  *
316  * @since 2.6.0
317  *
318  * @param object $post
319  */
320 function post_trackback_meta_box($post) {
321     $form_trackback = '<input type="text" name="trackback_url" id="trackback_url" tabindex="7" value="'. attribute_escape( str_replace("\n", ' ', $post->to_ping) ) .'" />';
322     if ('' != $post->pinged) {
323         $pings = '<p>'. __('Already pinged:') . '</p><ul>';
324         $already_pinged = explode("\n", trim($post->pinged));
325         foreach ($already_pinged as $pinged_url) {
326             $pings .= "\n\t<li>" . wp_specialchars($pinged_url) . "</li>";
327         }
328         $pings .= '</ul>';
329     }
330
331 ?>
332 <p class="meta-options">
333     <label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked($post->ping_status, 'open'); ?> /> <?php _e('Allow <a href="http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments" target="_blank">trackbacks and pingbacks</a> on this post') ?></label>
334 </p>
335 <p><label for="trackback_url"><?php _e('Send trackbacks to:'); ?></label> <?php echo $form_trackback; ?><br /> (<?php _e('Separate multiple URLs with spaces'); ?>)</p>
336 <p><?php _e('Trackbacks are a way to notify legacy blog systems that you&#8217;ve linked to them. If you link other WordPress blogs they&#8217;ll be notified automatically using <a href="http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments" target="_blank">pingbacks</a>, no other action necessary.'); ?></p>
337 <?php
338 if ( ! empty($pings) )
339     echo $pings;
340 }
341 add_meta_box('trackbacksdiv', __('Trackbacks and Pings'), 'post_trackback_meta_box', 'post', 'normal', 'core');
342
343 /**
344  * Display custom fields for the post form fields.
345  *
346  * @since 2.6.0
347  *
348  * @param object $post
349  */
350 function post_custom_meta_box($post) {
351 ?>
352 <div id="postcustomstuff">
353 <table cellpadding="3">
354 <?php
355 $metadata = has_meta($post->ID);
356 list_meta($metadata);
357 ?>
358
359 </table>
360 <?php
361     meta_form();
362 ?>
363 <div id="ajax-response"></div>
364 </div>
365 <p><?php _e('Custom fields can be used to add extra metadata to a post that you can <a href="http://codex.wordpress.org/Using_Custom_Fields" target="_blank">use in your theme</a>.'); ?></p>
366 <?php
367 }
368 add_meta_box('postcustom', __('Custom Fields'), 'post_custom_meta_box', 'post', 'normal', 'core');
369
370 do_action('dbx_post_advanced');
371
372 /**
373  * Display comment status for post form fields.
374  *
375  * @since 2.6.0
376  *
377  * @param object $post
378  */
379 function post_comment_status_meta_box($post) {
380     global $wpdb, $post_ID;
381 ?>
382 <input name="advanced_view" type="hidden" value="1" />
383 <p class="meta-options">
384     <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 on this post') ?></label>
385 </p>
386 <?php
387
388     if ( !$post_ID || $post_ID < 0 )
389         return;
390
391     if ( !$comments = $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved != 'spam' ORDER BY comment_date", $post_ID) ) )
392         return;
393
394     // Make sure comments, post, and post_author are cached
395 //    update_comment_cache($comments);
396 ?>
397
398 <table class="widefat">
399 <thead>
400     <tr>
401         <th scope="col"><?php _e('Comments') ?></th>
402         <th scope="col"><?php _e('Author') ?></th>
403         <th scope="col"><?php _e('Submitted') ?></th>
404     </tr>
405 </thead>
406 <tbody id="the-comment-list" class="list:comment">
407 <?php
408     foreach ($comments as $comment)
409         _wp_comment_row( $comment, 'single', false, false );
410 ?>
411 </tbody>
412 </table>
413
414 <?php
415 }
416 add_meta_box('commentstatusdiv', __('Comments on this Post'), 'post_comment_status_meta_box', 'post', 'normal', 'core');
417
418 /**
419  * Display post password form fields.
420  *
421  * @since 2.6.0
422  *
423  * @param object $post
424  */
425 function post_password_meta_box($post) {
426 ?>
427 <p>
428     <label for="post_status_private" class="selectit"><input id="post_status_private" name="post_status" type="checkbox" value="private" <?php checked($post->post_status, 'private'); ?> tabindex="4" /> <?php _e('Keep this post private') ?></label>
429 </p>
430 <h4><?php _e( 'Post Password' ); ?></h4>
431 <p><label class="hidden" for="post_password"><?php _e('Password Protect This Post') ?></label><input name="post_password" type="text" size="25" id="post_password" value="<?php the_post_password(); ?>" /></p>
432 <p><?php _e('Setting a password will require people who visit your blog to enter the above password to view this post and its comments.'); ?></p>
433 <?php
434 }
435 add_meta_box('passworddiv', __('Privacy Options'), 'post_password_meta_box', 'post', 'normal', 'core');
436
437 /**
438  * Display post slug form fields.
439  *
440  * @since 2.6.0
441  *
442  * @param object $post
443  */
444 function post_slug_meta_box($post) {
445 ?>
446 <label class="hidden" for="post_name"><?php _e('Post Slug') ?></label><input name="post_name" type="text" size="13" id="post_name" value="<?php echo attribute_escape( $post->post_name ); ?>" />
447 <?php
448 }
449 if ( !( 'pending' == $post->post_status && !current_user_can( 'publish_posts' ) ) )
450     add_meta_box('slugdiv', __('Post Slug'), 'post_slug_meta_box', 'post', 'normal', 'core');
451
452 $authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM
453 if ( $post->post_author && !in_array($post->post_author, $authors) )
454     $authors[] = $post->post_author;
455 if ( $authors && count( $authors ) > 1 ) :
456 /**
457  * Display form field with list of authors.
458  *
459  * @since 2.6.0
460  *
461  * @param object $post
462  */
463 function post_author_meta_box($post) {
464     global $current_user, $user_ID;
465     $authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM
466     if ( $post->post_author && !in_array($post->post_author, $authors) )
467         $authors[] = $post->post_author;
468 ?>
469 <label class="hidden" for="post_author_override"><?php _e('Post Author'); ?></label><?php wp_dropdown_users( array('include' => $authors, 'name' => 'post_author_override', 'selected' => empty($post->ID) ? $user_ID : $post->post_author) ); ?>
470 <?php
471 }
472 add_meta_box('authordiv', __('Post Author'), 'post_author_meta_box', 'post', 'normal', 'core');
473 endif;
474
475 if ( 0 < $post_ID && wp_get_post_revisions( $post_ID ) ) :
476 /**
477  * Display list of post revisions.
478  *
479  * @since 2.6.0
480  *
481  * @param object $post
482  */
483 function post_revisions_meta_box($post) {
484     wp_list_post_revisions();
485 }
486 add_meta_box('revisionsdiv', __('Post Revisions'), 'post_revisions_meta_box', 'post', 'normal', 'core');
487 endif;
488
489 ?>
490
491 <div id="edit-settings-wrap" class="hidden">
492 <h5><?php _e('Show on screen') ?></h5>
493 <form id="adv-settings" action="" method="get">
494 <div class="metabox-prefs">
495 <?php meta_box_prefs('post') ?>
496 <br class="clear" />
497 </div></form>
498 </div>
499
500 <?php if ( $notice ) : ?>
501 <div id="notice" class="error"><p><?php echo $notice ?></p></div>
502 <?php endif; ?>
503 <?php if (isset($_GET['message'])) : ?>
504 <div id="message" class="updated fade"><p><?php echo $messages[$_GET['message']]; ?></p></div>
505 <?php endif; ?>
506
507 <?php if ( (isset($mode) && 'bookmarklet' == $mode) || isset($_GET['popupurl']) ): ?>
508 <input type="hidden" name="mode" value="bookmarklet" />
509 <?php endif; ?>
510
511 <div class="wrap">
512
513 <form name="post" action="post.php" method="post" id="post">
514 <?php
515
516 if ( 0 == $post_ID)
517     wp_nonce_field('add-post');
518 else
519     wp_nonce_field('update-post_' $post_ID);
520
521 ?>
522
523 <input type="hidden" id="user-id" name="user_ID" value="<?php echo (int) $user_ID ?>" />
524 <input type="hidden" id="hiddenaction" name="action" value="<?php echo $form_action ?>" />
525 <input type="hidden" id="originalaction" name="originalaction" value="<?php echo $form_action ?>" />
526 <input type="hidden" id="post_author" name="post_author" value="<?php echo attribute_escape( $post->post_author ); ?>" />
527 <input type="hidden" id="post_type" name="post_type" value="<?php echo $post->post_type ?>" />
528 <input type="hidden" id="original_post_status" name="original_post_status" value="<?php echo $post->post_status ?>" />
529 <input name="referredby" type="hidden" id="referredby" value="<?php echo clean_url(stripslashes(wp_get_referer())); ?>" />
530 <?php if ( 'draft' != $post->post_status ) wp_original_referer_field(true, 'previous'); ?>
531
532 <?php echo $form_extra ?>
533
534 <div id="poststuff" class="metabox-holder">
535
536 <div id="side-info" style="display: none;"><?php // TODO ?>
537
538 <h5><?php _e('Related') ?></h5>
539 <ul>
540 <?php if ($post_ID): ?>
541 <li><a href="edit.php?p=<?php echo $post_ID ?>"><?php _e(