Changeset 43571 for trunk/src/wp-admin/edit-form-advanced.php
- Timestamp:
- 08/17/2018 01:50:26 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/edit-form-advanced.php
r42871 r43571 159 159 $scheduled_date = date_i18n( __( 'M j, Y @ H:i' ), strtotime( $post->post_date ) ); 160 160 161 $messages['post'] = array(161 $messages['post'] = array( 162 162 0 => '', // Unused. Messages start at index 1. 163 163 1 => __( 'Post updated.' ) . $view_post_link_html, … … 173 173 10 => __( 'Post draft updated.' ) . $preview_post_link_html, 174 174 ); 175 $messages['page'] = array(175 $messages['page'] = array( 176 176 0 => '', // Unused. Messages start at index 1. 177 177 1 => __( 'Page updated.' ) . $view_page_link_html, … … 395 395 396 396 add_screen_option( 397 'layout_columns', array( 397 'layout_columns', 398 array( 398 399 'max' => 2, 399 400 'default' => 2, … … 587 588 <?php if ( ! empty( $active_post_lock ) ) { ?> 588 589 <input type="hidden" id="active_post_lock" value="<?php echo esc_attr( implode( ':', $active_post_lock ) ); ?>" /> 589 <?php590 <?php 590 591 } 591 592 if ( 'draft' != get_post_status( $post ) ) { … … 633 634 <input type="text" name="post_title" size="30" value="<?php echo esc_attr( $post->post_title ); ?>" id="title" spellcheck="true" autocomplete="off" /> 634 635 </div> 635 <?php636 /**637 * Fires before the permalink field in the edit form.638 *639 * @since 4.1.0640 *641 * @param WP_Post $post Post object.642 */643 do_action( 'edit_form_before_permalink', $post );644 ?>636 <?php 637 /** 638 * Fires before the permalink field in the edit form. 639 * 640 * @since 4.1.0 641 * 642 * @param WP_Post $post Post object. 643 */ 644 do_action( 'edit_form_before_permalink', $post ); 645 ?> 645 646 <div class="inside"> 646 <?php 647 if ( $viewable ) : 648 $sample_permalink_html = $post_type_object->public ? get_sample_permalink_html( $post->ID ) : ''; 649 650 // As of 4.4, the Get Shortlink button is hidden by default. 651 if ( has_filter( 'pre_get_shortlink' ) || has_filter( 'get_shortlink' ) ) { 652 $shortlink = wp_get_shortlink( $post->ID, 'post' ); 653 654 if ( ! empty( $shortlink ) && $shortlink !== $permalink && $permalink !== home_url( '?page_id=' . $post->ID ) ) { 655 $sample_permalink_html .= '<input id="shortlink" type="hidden" value="' . esc_attr( $shortlink ) . '" /><button type="button" class="button button-small" onclick="prompt('URL:', jQuery(\'#shortlink\').val());">' . __( 'Get Shortlink' ) . '</button>'; 647 <?php 648 if ( $viewable ) : 649 $sample_permalink_html = $post_type_object->public ? get_sample_permalink_html( $post->ID ) : ''; 650 651 // As of 4.4, the Get Shortlink button is hidden by default. 652 if ( has_filter( 'pre_get_shortlink' ) || has_filter( 'get_shortlink' ) ) { 653 $shortlink = wp_get_shortlink( $post->ID, 'post' ); 654 655 if ( ! empty( $shortlink ) && $shortlink !== $permalink && $permalink !== home_url( '?page_id=' . $post->ID ) ) { 656 $sample_permalink_html .= '<input id="shortlink" type="hidden" value="' . esc_attr( $shortlink ) . '" /><button type="button" class="button button-small" onclick="prompt('URL:', jQuery(\'#shortlink\').val());">' . __( 'Get Shortlink' ) . '</button>'; 657 } 656 658 } 657 } 658 659 if ( $post_type_object->public && ! ( 'pending' == get_post_status( $post ) && ! current_user_can( $post_type_object->cap->publish_posts ) ) ) { 660 $has_sample_permalink = $sample_permalink_html && 'auto-draft' != $post->post_status; 659 660 if ( $post_type_object->public && ! ( 'pending' == get_post_status( $post ) && ! current_user_can( $post_type_object->cap->publish_posts ) ) ) { 661 $has_sample_permalink = $sample_permalink_html && 'auto-draft' != $post->post_status; 662 ?> 663 <div id="edit-slug-box" class="hide-if-no-js"> 664 <?php 665 if ( $has_sample_permalink ) { 666 echo $sample_permalink_html; 667 } 668 ?> 669 </div> 670 <?php 671 } 672 endif; 661 673 ?> 662 <div id="edit-slug-box" class="hide-if-no-js">674 </div> 663 675 <?php 664 if ( $has_sample_permalink ) { 665 echo $sample_permalink_html; 666 } 676 wp_nonce_field( 'samplepermalink', 'samplepermalinknonce', false ); 667 677 ?> 668 </div>678 </div><!-- /titlediv --> 669 679 <?php 670 }671 endif;672 ?>673 </div>674 <?php675 wp_nonce_field( 'samplepermalink', 'samplepermalinknonce', false );676 ?>677 </div><!-- /titlediv -->678 <?php679 680 } 680 681 /** … … 692 693 $_wp_editor_expand_class = ' wp-editor-expand'; 693 694 } 694 ?>695 ?> 695 696 <div id="postdivrich" class="postarea<?php echo $_wp_editor_expand_class; ?>"> 696 697 697 <?php 698 wp_editor( 699 $post->post_content, 'content', array( 700 '_content_editor_dfw' => $_content_editor_dfw, 701 'drag_drop_upload' => true, 702 'tabfocus_elements' => 'content-html,save-post', 703 'editor_height' => 300, 704 'tinymce' => array( 705 'resize' => false, 706 'wp_autoresize_on' => $_wp_editor_expand, 707 'add_unload_trigger' => false, 708 'wp_keep_scroll_position' => ! $is_IE, 709 ), 710 ) 711 ); 712 ?> 698 <?php 699 wp_editor( 700 $post->post_content, 701 'content', 702 array( 703 '_content_editor_dfw' => $_content_editor_dfw, 704 'drag_drop_upload' => true, 705 'tabfocus_elements' => 'content-html,save-post', 706 'editor_height' => 300, 707 'tinymce' => array( 708 'resize' => false, 709 'wp_autoresize_on' => $_wp_editor_expand, 710 'add_unload_trigger' => false, 711 'wp_keep_scroll_position' => ! $is_IE, 712 ), 713 ) 714 ); 715 ?> 713 716 <table id="post-status-info"><tbody><tr> 714 717 <td id="wp-word-count" class="hide-if-no-js"><?php printf( __( 'Word count: %s' ), '<span class="word-count">0</span>' ); ?></td> 715 718 <td class="autosave-info"> 716 719 <span class="autosave-message"> </span> 717 <?php718 if ( 'auto-draft' != $post->post_status ) {719 echo '<span id="last-edit">';720 if ( $last_user = get_userdata( get_post_meta( $post_ID, '_edit_last', true ) ) ) {721 /* translators: 1: Name of most recent post author, 2: Post edited date, 3: Post edited time */722 printf( __( 'Last edited by %1$s on %2$s at %3$s' ), esc_html( $last_user->display_name ), mysql2date( __( 'F j, Y' ), $post->post_modified ), mysql2date( __( 'g:i a' ), $post->post_modified ) );723 } else {724 /* translators: 1: Post edited date, 2: Post edited time */725 printf( __( 'Last edited on %1$s at %2$s' ), mysql2date( __( 'F j, Y' ), $post->post_modified ), mysql2date( __( 'g:i a' ), $post->post_modified ) );726 }727 echo '</span>';728 }720 <?php 721 if ( 'auto-draft' != $post->post_status ) { 722 echo '<span id="last-edit">'; 723 if ( $last_user = get_userdata( get_post_meta( $post_ID, '_edit_last', true ) ) ) { 724 /* translators: 1: Name of most recent post author, 2: Post edited date, 3: Post edited time */ 725 printf( __( 'Last edited by %1$s on %2$s at %3$s' ), esc_html( $last_user->display_name ), mysql2date( __( 'F j, Y' ), $post->post_modified ), mysql2date( __( 'g:i a' ), $post->post_modified ) ); 726 } else { 727 /* translators: 1: Post edited date, 2: Post edited time */ 728 printf( __( 'Last edited on %1$s at %2$s' ), mysql2date( __( 'F j, Y' ), $post->post_modified ), mysql2date( __( 'g:i a' ), $post->post_modified ) ); 729 } 730 echo '</span>'; 731 } 729 732 ?> 730 733 </td> … … 733 736 734 737 </div> 735 <?php738 <?php 736 739 } 737 740 /**
Note: See TracChangeset
for help on using the changeset viewer.