]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/edit-form-advanced.php
WordPress 3.9-scripts
[autoinstalls/wordpress.git] / wp-admin / edit-form-advanced.php
index dab3f84e5e8a2647bde6e079ce8b9c8ea850611e..8dc481508f584c23e48465ae78d3de034450ec93 100644 (file)
@@ -24,7 +24,16 @@ $post_ID = isset($post_ID) ? (int) $post_ID : 0;
 $user_ID = isset($user_ID) ? (int) $user_ID : 0;
 $action = isset($action) ? $action : '';
 
-if ( post_type_supports($post_type, 'editor') || post_type_supports($post_type, 'thumbnail') ) {
+$thumbnail_support = current_theme_supports( 'post-thumbnails', $post_type ) && post_type_supports( $post_type, 'thumbnail' );
+if ( ! $thumbnail_support && 'attachment' === $post_type && $post->post_mime_type ) {
+       if ( 0 === strpos( $post->post_mime_type, 'audio/' ) ) {
+               $thumbnail_support = post_type_supports( 'attachment:audio', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:audio' );
+       } elseif ( 0 === strpos( $post->post_mime_type, 'video/' ) ) {
+               $thumbnail_support = post_type_supports( 'attachment:video', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:video' );
+       }
+}
+
+if ( $thumbnail_support ) {
        add_thickbox();
        wp_enqueue_media( array( 'post' => $post_ID ) );
 }
@@ -48,7 +57,7 @@ $messages['post'] = array(
         7 => __('Post saved.'),
         8 => sprintf( __('Post submitted. <a target="_blank" href="%s">Preview post</a>'), esc_url( add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ) ),
         9 => sprintf( __('Post scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview post</a>'),
-               // translators: Publish box date format, see http://php.net/date
+               /* translators: Publish box date format, see http://php.net/date */
                date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ), esc_url( get_permalink($post_ID) ) ),
        10 => sprintf( __('Post draft updated. <a target="_blank" href="%s">Preview post</a>'), esc_url( add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ) ),
 );
@@ -137,6 +146,10 @@ if ( 'attachment' == $post_type ) {
        wp_enqueue_style( 'imgareaselect' );
        add_meta_box( 'submitdiv', __('Save'), 'attachment_submit_meta_box', null, 'side', 'core' );
        add_action( 'edit_form_after_title', 'edit_form_image_editor' );
+
+       if ( 0 === strpos( $post->post_mime_type, 'audio/' ) ) {
+               add_meta_box( 'attachment-id3', __( 'Metadata' ), 'attachment_id3_data_meta_box', null, 'normal', 'core' );
+       }
 } else {
        add_meta_box( 'submitdiv', __( 'Publish' ), 'post_submit_meta_box', null, 'side', 'core', $publish_callback_args );
 }
@@ -147,7 +160,7 @@ if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post_type,
 // all taxonomies
 foreach ( get_object_taxonomies( $post ) as $tax_name ) {
        $taxonomy = get_taxonomy( $tax_name );
-       if ( ! $taxonomy->show_ui )
+       if ( ! $taxonomy->show_ui || false === $taxonomy->meta_box_cb )
                continue;
 
        $label = $taxonomy->labels->name;
@@ -163,14 +176,7 @@ foreach ( get_object_taxonomies( $post ) as $tax_name ) {
 if ( post_type_supports($post_type, 'page-attributes') )
        add_meta_box('pageparentdiv', 'page' == $post_type ? __('Page Attributes') : __('Attributes'), 'page_attributes_meta_box', null, 'side', 'core');
 
-$audio_post_support = $video_post_support = false;
-$theme_support = current_theme_supports( 'post-thumbnails', $post_type ) && post_type_supports( $post_type, 'thumbnail' );
-if ( 'attachment' === $post_type && ! empty( $post->post_mime_type ) ) {
-       $audio_post_support = 0 === strpos( $post->post_mime_type, 'audio/' ) && current_theme_supports( 'post-thumbnails', 'attachment:audio' ) && post_type_supports( 'attachment:audio', 'thumbnail' );
-       $video_post_support = 0 === strpos( $post->post_mime_type, 'video/' ) && current_theme_supports( 'post-thumbnails', 'attachment:video' ) && post_type_supports( 'attachment:video', 'thumbnail' );
-}
-
-if ( $theme_support || $audio_post_support || $video_post_support )
+if ( $thumbnail_support )
        add_meta_box('postimagediv', __('Featured Image'), 'post_thumbnail_meta_box', null, 'side', 'low');
 
 if ( post_type_supports($post_type, 'excerpt') )
@@ -257,6 +263,7 @@ if ( 'post' == $post_type ) {
 
        $title_and_editor  = '<p>' . __('<strong>Title</strong> - Enter a title for your post. After you enter a title, you&#8217;ll see the permalink below, which you can edit.') . '</p>';
        $title_and_editor .= '<p>' . __('<strong>Post editor</strong> - Enter the text for your post. There are two modes of editing: Visual and Text. Choose the mode by clicking on the appropriate tab. Visual mode gives you a WYSIWYG editor. Click the last icon in the row to get a second row of controls. The Text mode allows you to enter HTML along with your post text. Line breaks will be converted to paragraphs automatically. You can insert media files by clicking the icons above the post editor and following the directions. You can go to the distraction-free writing screen via the Fullscreen icon in Visual mode (second to last in the top row) or the Fullscreen button in Text mode (last in the row). Once there, you can make buttons visible by hovering over the top area. Exit Fullscreen back to the regular post editor.') . '</p>';
+       $title_and_editor .= '<p>' . __( 'Keyboard users: When you&#8217;re working in the visual editor, you can use <kbd>Alt + F10</kbd> to access the toolbar.' ) . '</p>';
 
        get_current_screen()->add_help_tab( array(
                'id'      => 'title-post-editor',
@@ -268,7 +275,7 @@ if ( 'post' == $post_type ) {
                        '<p>' . sprintf(__('You can also create posts with the <a href="%s">Press This bookmarklet</a>.'), 'options-writing.php') . '</p>' .
                        '<p><strong>' . __('For more information:') . '</strong></p>' .
                        '<p>' . __('<a href="http://codex.wordpress.org/Posts_Add_New_Screen" target="_blank">Documentation on Writing and Editing Posts</a>') . '</p>' .
-                       '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
+                       '<p>' . __('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
        );
 } elseif ( 'page' == $post_type ) {
        $about_pages = '<p>' . __('Pages are similar to Posts in that they have a title, body text, and associated metadata, but they are different in that they are not part of the chronological blog stream, kind of like permanent posts. Pages are not categorized or tagged, but can have a hierarchy. You can nest Pages under other Pages by making one the &#8220;Parent&#8221; of the other, creating a group of Pages.') . '</p>' .
@@ -284,7 +291,7 @@ if ( 'post' == $post_type ) {
                        '<p><strong>' . __('For more information:') . '</strong></p>' .
                        '<p>' . __('<a href="http://codex.wordpress.org/Pages_Add_New_Screen" target="_blank">Documentation on Adding New Pages</a>') . '</p>' .
                        '<p>' . __('<a href="http://codex.wordpress.org/Pages_Screen#Editing_Individual_Pages" target="_blank">Documentation on Editing Pages</a>') . '</p>' .
-                       '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
+                       '<p>' . __('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
        );
 } elseif ( 'attachment' == $post_type ) {
        get_current_screen()->add_help_tab( array(
@@ -300,7 +307,7 @@ if ( 'post' == $post_type ) {
        get_current_screen()->set_help_sidebar(
        '<p><strong>' . __('For more information:') . '</strong></p>' .
        '<p>' . __('<a href="http://codex.wordpress.org/Media_Add_New_Screen#Edit_Media" target="_blank">Documentation on Edit Media</a>') . '</p>' .
-       '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
+       '<p>' . __('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
        );
 }
 
@@ -359,7 +366,6 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
 ?>
 
 <div class="wrap">
-<?php screen_icon(); ?>
 <h2><?php
 echo esc_html( $title );
 if ( isset( $post_new_file ) && current_user_can( $post_type_object->cap->create_posts ) )
@@ -403,7 +409,6 @@ if ( 'draft' != get_post_status( $post ) )
 
 echo $form_extra;
 
-wp_nonce_field( 'autosave', 'autosavenonce', false );
 wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
 wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
 ?>
@@ -482,10 +487,15 @@ if ( post_type_supports($post_type, 'editor') ) {
 
 <?php wp_editor( $post->post_content, 'content', array(
        'dfw' => true,
+       'drag_drop_upload' => true,
        'tabfocus_elements' => 'insert-media-button,save-post',
        'editor_height' => 360,
+       'tinymce' => array(
+               'resize' => false,
+               'add_unload_trigger' => false,
+       ),
 ) ); ?>
-<table id="post-status-info" cellspacing="0"><tbody><tr>
+<table id="post-status-info"><tbody><tr>
        <td id="wp-word-count"><?php printf( __( 'Word count: %s' ), '<span class="word-count">0</span>' ); ?></td>
        <td class="autosave-info">
        <span class="autosave-message">&nbsp;</span>
@@ -500,6 +510,7 @@ if ( post_type_supports($post_type, 'editor') ) {
                echo '</span>';
        } ?>
        </td>
+       <td id="content-resize-handle" class="hide-if-no-js"><br /></td>
 </tr></tbody></table>
 
 </div>
@@ -557,7 +568,7 @@ if ( 'page' == $post_type ) {
        /**
         * Fires after 'normal' context meta boxes have been output for the 'page' post type.
         *
-        * @since 1.5.2
+        * @since 1.5.0
         *
         * @param WP_Post $post Post object.
         */
@@ -567,7 +578,7 @@ else {
        /**
         * Fires after 'normal' context meta boxes have been output for all post types other than 'page'.
         *
-        * @since 1.5.2
+        * @since 1.5.0
         *
         * @param WP_Post $post Post object.
         */