-
+ 8203C7E8B4A682A7AE9838B7AD7971654FC2F25081D91C96C0FC813394180E927454144D469963440381EF808FD793B94EA2F047263C87781DED15314B7DEC12
mp-wp/wp-admin/edit-form-advanced.php
(0 . 0)(1 . 625)
10274 <?php
10275 /**
10276 * Post advanced form for inclusion in the administration panels.
10277 *
10278 * @package WordPress
10279 * @subpackage Administration
10280 */
10281
10282 /**
10283 * Post ID global
10284 * @name $post_ID
10285 * @var int
10286 */
10287 if ( ! isset( $post_ID ) )
10288 $post_ID = 0;
10289 else
10290 $post_ID = (int) $post_ID;
10291
10292 $action = isset($action) ? $action : '';
10293 if ( isset($_GET['message']) )
10294 $_GET['message'] = absint( $_GET['message'] );
10295 $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'] : '') ) ) );
10296 $messages[2] = __('Custom field updated.');
10297 $messages[3] = __('Custom field deleted.');
10298 $messages[4] = __('Post updated.');
10299 $messages[6] = sprintf(__('Post published. <a href="%s">View post</a>'), get_permalink($post_ID));
10300 $messages[7] = __('Post saved.');
10301 $messages[8] = sprintf(__('Post submitted. <a href="%s">Preview post</a>'), add_query_arg( 'preview', 'true', get_permalink($post_ID) ) );
10302
10303 if ( isset($_GET['revision']) )
10304 $messages[5] = sprintf( __('Post restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) );
10305
10306 $notice = false;
10307 $notices[1] = __( 'There is an autosave of this post that is more recent than the version below. <a href="%s">View the autosave</a>.' );
10308
10309 if ( 0 == $post_ID ) {
10310 $form_action = 'post';
10311 $temp_ID = -1 * time(); // don't change this formula without looking at wp_write_post()
10312 $form_extra = "<input type='hidden' id='post_ID' name='temp_ID' value='$temp_ID' />";
10313 $autosave = false;
10314 } else {
10315 $form_action = 'editpost';
10316 $form_extra = "<input type='hidden' id='post_ID' name='post_ID' value='$post_ID' />";
10317 $autosave = wp_get_post_autosave( $post_ID );
10318
10319 // Detect if there exists an autosave newer than the post and if that autosave is different than the post
10320 if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt ) > mysql2date( 'U', $post->post_modified_gmt ) ) {
10321 foreach ( _wp_post_revision_fields() as $autosave_field => $_autosave_field ) {
10322 if ( normalize_whitespace( $autosave->$autosave_field ) != normalize_whitespace( $post->$autosave_field ) ) {
10323 $notice = sprintf( $notices[1], get_edit_post_link( $autosave->ID ) );
10324 break;
10325 }
10326 }
10327 unset($autosave_field, $_autosave_field);
10328 }
10329 }
10330
10331 // All meta boxes should be defined and added before the first do_meta_boxes() call (or potentially during the do_meta_boxes action).
10332
10333 /**
10334 * Display post submit form fields.
10335 *
10336 * @since 2.7.0
10337 *
10338 * @param object $post
10339 */
10340 function post_submit_meta_box($post) {
10341 global $action;
10342
10343 $can_publish = current_user_can('publish_posts');
10344 ?>
10345 <div class="submitbox" id="submitpost">
10346
10347 <div id="minor-publishing">
10348
10349 <?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>
10350 <div style="display:none;">
10351 <input type="submit" name="save" value="<?php echo attribute_escape( __('Save') ); ?>" />
10352 </div>
10353
10354 <div id="minor-publishing-actions">
10355 <div id="save-action">
10356 <?php if ( 'publish' != $post->post_status && 'future' != $post->post_status && 'pending' != $post->post_status ) { ?>
10357 <input <?php if ( 'private' == $post->post_status ) { ?>style="display:none"<?php } ?> type="submit" name="save" id="save-post" value="<?php echo attribute_escape( __('Save Draft') ); ?>" tabindex="4" class="button button-highlighted" />
10358 <?php } elseif ( 'pending' == $post->post_status && $can_publish ) { ?>
10359 <input type="submit" name="save" id="save-post" value="<?php echo attribute_escape( __('Save as Pending') ); ?>" tabindex="4" class="button button-highlighted" />
10360 <?php } ?>
10361 </div>
10362
10363 <div id="preview-action">
10364 <?php $preview_link = 'publish' == $post->post_status ? clean_url(get_permalink($post->ID)) : clean_url(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post->ID)))); ?>
10365
10366 <a class="preview button" href="<?php echo $preview_link; ?>" target="wp-preview" id="post-preview" tabindex="4"><?php _e('Preview'); ?></a>
10367 <input type="hidden" name="wp-preview" id="wp-preview" value="" />
10368 </div>
10369
10370 <div class="clear"></div>
10371 </div><?php // /minor-publishing-actions ?>
10372
10373 <div id="misc-publishing-actions">
10374
10375 <div class="misc-pub-section<?php if ( !$can_publish ) { echo ' misc-pub-section-last'; } ?>"><label for="post_status"><?php _e('Status:') ?></label>
10376 <b><span id="post-status-display">
10377 <?php
10378 switch ( $post->post_status ) {
10379 case 'private':
10380 _e('Privately Published');
10381 break;
10382 case 'publish':
10383 _e('Published');
10384 break;
10385 case 'future':
10386 _e('Scheduled');
10387 break;
10388 case 'pending':
10389 _e('Pending Review');
10390 break;
10391 case 'draft':
10392 _e('Draft');
10393 break;
10394 }
10395 ?>
10396 </span></b>
10397 <?php if ( 'publish' == $post->post_status || 'private' == $post->post_status || $can_publish ) { ?>
10398 <a href="#post_status" <?php if ( 'private' == $post->post_status ) { ?>style="display:none;" <?php } ?>class="edit-post-status hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a>
10399
10400 <div id="post-status-select" class="hide-if-js">
10401 <input type="hidden" name="hidden_post_status" id="hidden_post_status" value="<?php echo $post->post_status; ?>" />
10402 <select name='post_status' id='post_status' tabindex='4'>
10403 <?php if ( 'publish' == $post->post_status ) : ?>
10404 <option<?php selected( $post->post_status, 'publish' ); ?> value='publish'><?php _e('Published') ?></option>
10405 <?php elseif ( 'private' == $post->post_status ) : ?>
10406 <option<?php selected( $post->post_status, 'private' ); ?> value='publish'><?php _e('Privately Published') ?></option>
10407 <?php elseif ( 'future' == $post->post_status ) : ?>
10408 <option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e('Scheduled') ?></option>
10409 <?php endif; ?>
10410 <option<?php selected( $post->post_status, 'pending' ); ?> value='pending'><?php _e('Pending Review') ?></option>
10411 <option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e('Draft') ?></option>
10412 </select>
10413 <a href="#post_status" class="save-post-status hide-if-no-js button"><?php _e('OK'); ?></a>
10414 <a href="#post_status" class="cancel-post-status hide-if-no-js"><?php _e('Cancel'); ?></a>
10415 </div>
10416
10417 <?php } ?>
10418 </div><?php // /misc-pub-section ?>
10419
10420 <div class="misc-pub-section " id="visibility">
10421 <?php _e('Visibility:'); ?> <b><span id="post-visibility-display"><?php
10422
10423 if ( 'private' == $post->post_status ) {
10424 $post->post_password = '';
10425 $visibility = 'private';
10426 $visibility_trans = __('Private');
10427 } elseif ( !empty( $post->post_password ) ) {
10428 $visibility = 'password';
10429 $visibility_trans = __('Password protected');
10430 } elseif ( is_sticky( $post->ID ) ) {
10431 $visibility = 'public';
10432 $visibility_trans = __('Public, Sticky');
10433 } else {
10434 $visibility = 'public';
10435 $visibility_trans = __('Public');
10436 }
10437
10438 ?><?php echo wp_specialchars( $visibility_trans ); ?></span></b> <?php if ( $can_publish ) { ?> <a href="#visibility" class="edit-visibility hide-if-no-js"><?php _e('Edit'); ?></a>
10439
10440 <div id="post-visibility-select" class="hide-if-js">
10441 <input type="hidden" name="hidden_post_password" id="hidden-post-password" value="<?php echo attribute_escape($post->post_password); ?>" />
10442 <input type="checkbox" style="display:none" name="hidden_post_sticky" id="hidden-post-sticky" value="sticky" <?php checked(is_sticky($post->ID), true); ?> />
10443 <input type="hidden" name="hidden_post_visibility" id="hidden-post-visibility" value="<?php echo attribute_escape( $visibility ); ?>" />
10444
10445
10446 <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 />
10447 <span id="sticky-span"><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><br /></span>
10448 <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 />
10449 <span id="password-span"><label for="post_password"><?php _e('Password:'); ?></label> <input type="text" name="post_password" id="post_password" value="<?php echo attribute_escape($post->post_password); ?>" /><br /></span>
10450 <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 />
10451
10452 <p>
10453 <a href="#visibility" class="save-post-visibility hide-if-no-js button"><?php _e('OK'); ?></a>
10454 <a href="#visibility" class="cancel-post-visibility hide-if-no-js"><?php _e('Cancel'); ?></a>
10455 </p>
10456 </div>
10457 <?php } ?>
10458
10459 </div><?php // /misc-pub-section ?>
10460
10461
10462 <?php
10463 $datef = _c( 'M j, Y @ G:i|Publish box date format');
10464 if ( 0 != $post->ID ) {
10465 if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date
10466 $stamp = __('Scheduled for: <b>%1$s</b>');
10467 } else if ( 'publish' == $post->post_status || 'private' == $post->post_status ) { // already published
10468 $stamp = __('Published on: <b>%1$s</b>');
10469 } else if ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified
10470 $stamp = __('Publish <b>immediately</b>');
10471 } else if ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) { // draft, 1 or more saves, future date specified
10472 $stamp = __('Schedule for: <b>%1$s</b>');
10473 } else { // draft, 1 or more saves, date specified
10474 $stamp = __('Publish on: <b>%1$s</b>');
10475 }
10476 $date = date_i18n( $datef, strtotime( $post->post_date ) );
10477 } else { // draft (no saves, and thus no date specified)
10478 $stamp = __('Publish <b>immediately</b>');
10479 $date = date_i18n( $datef, strtotime( current_time('mysql') ) );
10480 }
10481 ?>
10482 <?php if ( $can_publish ) : // Contributors don't get to choose the date of publish ?>
10483 <div class="misc-pub-section curtime misc-pub-section-last">
10484 <span id="timestamp">
10485 <?php printf($stamp, $date); ?></span>
10486 <a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a>
10487 <div id="timestampdiv" class="hide-if-js"><?php touch_time(($action == 'edit'),1,4); ?></div>
10488 </div><?php // /misc-pub-section ?>
10489 <?php endif; ?>
10490
10491 </div>
10492 <div class="clear"></div>
10493 </div>
10494
10495 <div id="major-publishing-actions">
10496 <?php do_action('post_submitbox_start'); ?>
10497 <div id="delete-action">
10498 <?php
10499 if ( ( 'edit' == $action ) && current_user_can('delete_post', $post->ID) ) { ?>
10500 <a class="submitdelete deletion" href="<?php echo wp_nonce_url("post.php?action=delete&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'); ?></a>
10501 <?php } ?>
10502 </div>
10503
10504 <div id="publishing-action">
10505 <?php
10506 if ( !in_array( $post->post_status, array('publish', 'future', 'private') ) || 0 == $post->ID ) { ?>
10507 <?php if ( current_user_can('publish_posts') ) : ?>
10508 <?php if ( !empty($post->post_date_gmt) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : ?>
10509 <input name="original_publish" type="hidden" id="original_publish" value="<?php _e('Schedule') ?>" />
10510 <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Schedule') ?>" />
10511 <?php else : ?>
10512 <input name="original_publish" type="hidden" id="original_publish" value="<?php _e('Publish') ?>" />
10513 <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Publish') ?>" />
10514 <?php endif; ?>
10515 <?php else : ?>
10516 <input name="original_publish" type="hidden" id="original_publish" value="<?php _e('Submit for Review') ?>" />
10517 <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Submit for Review') ?>" />
10518 <?php endif; ?>
10519 <?php } else { ?>
10520 <input name="original_publish" type="hidden" id="original_publish" value="<?php _e('Update Post') ?>" />
10521 <input name="save" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Update Post') ?>" />
10522 <?php } ?>
10523 </div>
10524 <div class="clear"></div>
10525 </div>
10526 </div>
10527
10528 <?php
10529 }
10530 add_meta_box('submitdiv', __('Publish'), 'post_submit_meta_box', 'post', 'side', 'core');
10531
10532 /**
10533 * Display post tags form fields.
10534 *
10535 * @since 2.6.0
10536 *
10537 * @param object $post
10538 */
10539 function post_tags_meta_box($post) {
10540 ?>
10541 <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>
10542 <div id="tagchecklist"></div>
10543 <p id="tagcloud-link" class="hide-if-no-js"><a href='#'><?php _e( 'Choose from the most popular tags' ); ?></a></p>
10544 <?php
10545 }
10546 add_meta_box('tagsdiv', __('Tags'), 'post_tags_meta_box', 'post', 'side', 'core');
10547
10548 /**
10549 * Display post categories form fields.
10550 *
10551 * @since 2.6.0
10552 *
10553 * @param object $post
10554 */
10555 function post_categories_meta_box($post) {
10556 ?>
10557 <ul id="category-tabs">
10558 <li class="ui-tabs-selected"><a href="#categories-all" tabindex="3"><?php _e( 'All Categories' ); ?></a></li>
10559 <li class="hide-if-no-js"><a href="#categories-pop" tabindex="3"><?php _e( 'Most Used' ); ?></a></li>
10560 </ul>
10561
10562 <div id="categories-pop" class="ui-tabs-panel" style="display: none;">
10563 <ul id="categorychecklist-pop" class="categorychecklist form-no-clear" >
10564 <?php $popular_ids = wp_popular_terms_checklist('category'); ?>
10565 </ul>
10566 </div>
10567
10568 <div id="categories-all" class="ui-tabs-panel">
10569 <ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
10570 <?php wp_category_checklist($post->ID, false, false, $popular_ids) ?>
10571 </ul>
10572 </div>
10573
10574 <?php if ( current_user_can('manage_categories') ) : ?>
10575 <div id="category-adder" class="wp-hidden-children">
10576 <h4><a id="category-add-toggle" href="#category-add" class="hide-if-no-js" tabindex="3"><?php _e( '+ Add New Category' ); ?></a></h4>
10577 <p id="category-add" class="wp-hidden-child">
10578 <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"/>
10579 <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 ) ); ?>
10580 <input type="button" id="category-add-sumbit" class="add:categorychecklist:category-add button" value="<?php _e( 'Add' ); ?>" tabindex="3" />
10581 <?php wp_nonce_field( 'add-category', '_ajax_nonce', false ); ?>
10582 <span id="category-ajax-response"></span>
10583 </p>
10584 </div>
10585 <?php
10586 endif;
10587
10588 }
10589 add_meta_box('categorydiv', __('Categories'), 'post_categories_meta_box', 'post', 'side', 'core');
10590
10591 /**
10592 * Display post password form fields.
10593 *
10594 * @since 2.6.0
10595 *
10596 * @param object $post
10597 */
10598 function post_password_meta_box($post) {
10599 ?>
10600 <p>
10601 <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>
10602 </p>
10603 <h4><?php _e( 'Post Password' ); ?></h4>
10604 <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>
10605 <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>
10606 <?php
10607 }
10608 // add_meta_box('passworddiv', __('Privacy Options'), 'post_password_meta_box', 'post', 'side', 'core');
10609
10610 /**
10611 * Display post excerpt form fields.
10612 *
10613 * @since 2.6.0
10614 *
10615 * @param object $post
10616 */
10617 function post_excerpt_meta_box($post) {
10618 ?>
10619 <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>
10620 <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>
10621 <?php
10622 }
10623 add_meta_box('postexcerpt', __('Excerpt'), 'post_excerpt_meta_box', 'post', 'normal', 'core');
10624
10625 /**
10626 * Display trackback links form fields.
10627 *
10628 * @since 2.6.0
10629 *
10630 * @param object $post
10631 */
10632 function post_trackback_meta_box($post) {
10633 $form_trackback = '<input type="text" name="trackback_url" id="trackback_url" tabindex="7" value="'. attribute_escape( str_replace("\n", ' ', $post->to_ping) ) .'" />';
10634 if ('' != $post->pinged) {
10635 $pings = '<p>'. __('Already pinged:') . '</p><ul>';
10636 $already_pinged = explode("\n", trim($post->pinged));
10637 foreach ($already_pinged as $pinged_url) {
10638 $pings .= "\n\t<li>" . wp_specialchars($pinged_url) . "</li>";
10639 }
10640 $pings .= '</ul>';
10641 }
10642
10643 ?>
10644 <p><label for="trackback_url"><?php _e('Send trackbacks to:'); ?></label> <?php echo $form_trackback; ?><br /> (<?php _e('Separate multiple URLs with spaces'); ?>)</p>
10645 <p><?php _e('Trackbacks are a way to notify legacy blog systems that you’ve linked to them. If you link other WordPress blogs they’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>
10646 <?php
10647 if ( ! empty($pings) )
10648 echo $pings;
10649 }
10650 add_meta_box('trackbacksdiv', __('Send Trackbacks'), 'post_trackback_meta_box', 'post', 'normal', 'core');
10651
10652 /**
10653 * Display custom fields for the post form fields.
10654 *
10655 * @since 2.6.0
10656 *
10657 * @param object $post
10658 */
10659 function post_custom_meta_box($post) {
10660 ?>
10661 <div id="postcustomstuff">
10662 <div id="ajax-response"></div>
10663 <?php
10664 $metadata = has_meta($post->ID);
10665 list_meta($metadata);
10666 meta_form();
10667 ?>
10668 </div>
10669 <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>
10670 <?php
10671 }
10672 add_meta_box('postcustom', __('Custom Fields'), 'post_custom_meta_box', 'post', 'normal', 'core');
10673
10674 do_action('dbx_post_advanced');
10675
10676 /**
10677 * Display comment status for post form fields.
10678 *
10679 * @since 2.6.0
10680 *
10681 * @param object $post
10682 */
10683 function post_comment_status_meta_box($post) {
10684 global $wpdb, $post_ID;
10685 ?>
10686 <input name="advanced_view" type="hidden" value="1" />
10687 <p class="meta-options">
10688 <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><br />
10689 <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>
10690 </p>
10691 <?php
10692 $total = $wpdb->get_var($wpdb->prepare("SELECT count(1) FROM $wpdb->comments WHERE comment_post_ID = '%d' AND ( comment_approved = '0' OR comment_approved = '1')", $post_ID));
10693
10694 if ( !$post_ID || $post_ID < 0 || 1 > $total )
10695 return;
10696
10697 wp_nonce_field( 'get-comments', 'add_comment_nonce', false );
10698 ?>
10699
10700 <table class="widefat comments-box fixed" cellspacing="0" style="display:none;">
10701 <thead>
10702 <tr>
10703 <th scope="col" class="column-author"><?php _e('Author') ?></th>
10704 <th scope="col" class="column-comment"><?php echo _c('Comment|noun') ?></th>
10705 </tr>
10706 </thead>
10707 <tbody id="the-comment-list" class="list:comment">
10708 </tbody>
10709 </table>
10710 <p class="hide-if-no-js"><a href="#commentstatusdiv" id="show-comments" onclick="commentsBox.get(<?php echo $total; ?>);return false;"><?php _e('Show comments'); ?></a> <img class="waiting" style="display:none;" src="images/loading.gif" alt="" /></p>
10711 <?php
10712 $hidden = get_hidden_meta_boxes('post');
10713 if ( ! in_array('commentstatusdiv', $hidden) ) { ?>
10714 <script type="text/javascript">commentsBox.get(<?php echo $total; ?>, 10);</script>
10715 <?php
10716 }
10717 }
10718 add_meta_box('commentstatusdiv', __('Discussion'), 'post_comment_status_meta_box', 'post', 'normal', 'core');
10719
10720 /**
10721 * Display post slug form fields.
10722 *
10723 * @since 2.6.0
10724 *
10725 * @param object $post
10726 */
10727 function post_slug_meta_box($post) {
10728 ?>
10729 <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 ); ?>" />
10730 <?php
10731 }
10732 if ( !( 'pending' == $post->post_status && !current_user_can( 'publish_posts' ) ) )
10733 add_meta_box('slugdiv', __('Post Slug'), 'post_slug_meta_box', 'post', 'normal', 'core');
10734
10735 $authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM
10736 if ( $post->post_author && !in_array($post->post_author, $authors) )
10737 $authors[] = $post->post_author;
10738 if ( $authors && count( $authors ) > 1 ) :
10739 /**
10740 * Display form field with list of authors.
10741 *
10742 * @since 2.6.0
10743 *
10744 * @param object $post
10745 */
10746 function post_author_meta_box($post) {
10747 global $current_user, $user_ID;
10748 $authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM
10749 if ( $post->post_author && !in_array($post->post_author, $authors) )
10750 $authors[] = $post->post_author;
10751 ?>
10752 <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) ); ?>
10753 <?php
10754 }
10755 add_meta_box('authordiv', __('Post Author'), 'post_author_meta_box', 'post', 'normal', 'core');
10756 endif;
10757
10758 if ( 0 < $post_ID && wp_get_post_revisions( $post_ID ) ) :
10759 /**
10760 * Display list of post revisions.
10761 *
10762 * @since 2.6.0
10763 *
10764 * @param object $post
10765 */
10766 function post_revisions_meta_box($post) {
10767 wp_list_post_revisions();
10768 }
10769 add_meta_box('revisionsdiv', __('Post Revisions'), 'post_revisions_meta_box', 'post', 'normal', 'core');
10770 endif;
10771
10772 do_action('do_meta_boxes', 'post', 'normal', $post);
10773 do_action('do_meta_boxes', 'post', 'advanced', $post);
10774 do_action('do_meta_boxes', 'post', 'side', $post);
10775
10776 require_once('admin-header.php');
10777
10778 ?>
10779
10780 <?php if ( (isset($mode) && 'bookmarklet' == $mode) || isset($_GET['popupurl']) ): ?>
10781 <input type="hidden" name="mode" value="bookmarklet" />
10782 <?php endif; ?>
10783
10784 <div class="wrap">
10785 <?php screen_icon(); ?>
10786 <h2><?php echo wp_specialchars( $title ); ?></h2>
10787 <?php if ( $notice ) : ?>
10788 <div id="notice" class="error"><p><?php echo $notice ?></p></div>
10789 <?php endif; ?>
10790 <?php if (isset($_GET['message'])) : ?>
10791 <div id="message" class="updated fade"><p><?php echo $messages[$_GET['message']]; ?></p></div>
10792 <?php endif; ?>
10793 <form name="post" action="post.php" method="post" id="post">
10794 <?php
10795
10796 if ( 0 == $post_ID)
10797 wp_nonce_field('add-post');
10798 else
10799 wp_nonce_field('update-post_' . $post_ID);
10800
10801 ?>
10802
10803 <input type="hidden" id="user-id" name="user_ID" value="<?php echo (int) $user_ID ?>" />
10804 <input type="hidden" id="hiddenaction" name="action" value="<?php echo $form_action ?>" />
10805 <input type="hidden" id="originalaction" name="originalaction" value="<?php echo $form_action ?>" />
10806 <input type="hidden" id="post_author" name="post_author" value="<?php echo attribute_escape( $post->post_author ); ?>" />
10807 <input type="hidden" id="post_type" name="post_type" value="<?php echo $post->post_type ?>" />
10808 <input type="hidden" id="original_post_status" name="original_post_status" value="<?php echo $post->post_status ?>" />
10809 <input name="referredby" type="hidden" id="referredby" value="<?php echo clean_url(stripslashes(wp_get_referer())); ?>" />
10810 <?php if ( 'draft' != $post->post_status ) wp_original_referer_field(true, 'previous'); ?>
10811
10812 <?php echo $form_extra ?>
10813
10814 <div id="poststuff" class="metabox-holder">
10815
10816 <div id="side-info-column" class="inner-sidebar">
10817
10818 <?php do_action('submitpost_box'); ?>
10819
10820 <?php $side_meta_boxes = do_meta_boxes('post', 'side', $post); ?>
10821 </div>
10822
10823 <div id="post-body" class="<?php echo $side_meta_boxes ? 'has-sidebar' : ''; ?>">
10824 <div id="post-body-content" class="has-sidebar-content">
10825 <div id="titlediv">
10826 <div id="titlewrap">
10827 <input type="text" name="post_title" size="30" tabindex="1" value="<?php echo attribute_escape($post->post_title); ?>" id="title" autocomplete="off" />
10828 </div>
10829 <div class="inside">
10830 <?php $sample_permalink_html = get_sample_permalink_html($post->ID); ?>
10831 <?php if ( !( 'pending' == $post->post_status && !current_user_can( 'publish_posts' ) ) ) { ?>
10832 <div id="edit-slug-box">
10833 <?php if ( ! empty($post->ID) && ! empty($sample_permalink_html) ) :
10834 echo $sample_permalink_html;
10835 endif; ?>
10836 </div>
10837 <?php } ?>
10838 </div>
10839 </div>
10840
10841 <div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>" class="postarea">
10842
10843 <?php the_editor($post->post_content); ?>
10844
10845 <div id="post-status-info">
10846 <span id="wp-word-count" class="alignleft"></span>
10847 <span class="alignright">
10848 <span id="autosave"> </span>
10849 <?php
10850 if ( $post_ID ) {
10851 echo '<span id="last-edit">';
10852 if ( $last_id = get_post_meta($post_ID, '_edit_last', true) ) {
10853 $last_user = get_userdata($last_id);
10854 printf(__('Last edited by %1$s on %2$s at %3$s'), wp_specialchars( $last_user->display_name ), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified));
10855 } else {
10856 printf(__('Last edited on %1$s at %2$s'), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified));
10857 }
10858 echo '</span>';
10859 }
10860 ?>
10861 </span>
10862 <br class="clear" />
10863 </div>
10864
10865
10866 <?php wp_nonce_field( 'autosave', 'autosavenonce', false ); ?>
10867 <?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
10868 <?php wp_nonce_field( 'getpermalink', 'getpermalinknonce', false ); ?>
10869 <?php wp_nonce_field( 'samplepermalink', 'samplepermalinknonce', false ); ?>
10870 <?php wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?>
10871 </div>
10872
10873 <?php
10874
10875 do_meta_boxes('post', 'normal', $post);
10876
10877 do_action('edit_form_advanced');
10878
10879 do_meta_boxes('post', 'advanced', $post);
10880
10881 do_action('dbx_post_sidebar');
10882
10883 ?>
10884
10885 </div>
10886 </div>
10887 <br class="clear" />
10888 </div><!-- /poststuff -->
10889 </form>
10890 </div>
10891
10892 <?php wp_comment_reply(); ?>
10893
10894 <?php if ((isset($post->post_title) && '' == $post->post_title) || (isset($_GET['message']) && 2 > $_GET['message'])) : ?>
10895 <script type="text/javascript">
10896 try{document.post.title.focus();}catch(e){}
10897 </script>
10898 <?php endif; ?>