]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/class-wp-editor.php
WordPress 4.2-scripts
[autoinstalls/wordpress.git] / wp-includes / class-wp-editor.php
index 6148583d0c2b4262143dc281d3eb173a3c6f3361..ae02621539284d96f90b1064ac9910c2e4d31d06 100644 (file)
@@ -354,6 +354,7 @@ final class _WP_Editors {
                                                'wordpress',
                                                'wpautoresize',
                                                'wpeditimage',
+                                               'wpemoji',
                                                'wpgallery',
                                                'wplink',
                                                'wpdialogs',
@@ -484,15 +485,6 @@ final class _WP_Editors {
                                                ],
                                                strikethrough: {inline: 'del'}
                                        }",
-                                       'block_formats' =>
-                                               'Paragraph=p;' .
-                                               'Pre=pre;' .
-                                               'Heading 1=h1;' .
-                                               'Heading 2=h2;' .
-                                               'Heading 3=h3;' .
-                                               'Heading 4=h4;' .
-                                               'Heading 5=h5;' .
-                                               'Heading 6=h6',
                                        'relative_urls' => false,
                                        'remove_script_host' => false,
                                        'convert_urls' => false,
@@ -506,6 +498,7 @@ final class _WP_Editors {
                                        // Limit the preview styles in the menu/toolbar
                                        'preview_styles' => 'font-family font-size font-weight font-style text-decoration text-transform',
 
+                                       'end_container_on_empty_block' => true,
                                        'wpeditimage_disable_captions' => $no_captions,
                                        'wpeditimage_html5_captions' => current_theme_supports( 'html5', 'caption' ),
                                        'plugins' => implode( ',', $plugins ),
@@ -578,6 +571,12 @@ final class _WP_Editors {
                                 */
                                $mce_buttons = apply_filters( 'mce_buttons', $mce_buttons, $editor_id );
 
+                               $mce_buttons_2 = array( 'formatselect', 'underline', 'alignjustify', 'forecolor', 'pastetext', 'removeformat', 'charmap', 'outdent', 'indent', 'undo', 'redo' );
+
+                               if ( ! wp_is_mobile() ) {
+                                       $mce_buttons_2[] = 'wp_help';
+                               }
+
                                /**
                                 * Filter the second-row list of TinyMCE buttons (Visual tab).
                                 *
@@ -586,7 +585,7 @@ final class _WP_Editors {
                                 * @param array  $buttons   Second-row list of buttons.
                                 * @param string $editor_id Unique editor identifier, e.g. 'content'.
                                 */
-                               $mce_buttons_2 = apply_filters( 'mce_buttons_2', array( 'formatselect', 'underline', 'alignjustify', 'forecolor', 'pastetext', 'removeformat', 'charmap', 'outdent', 'indent', 'undo', 'redo', 'wp_help' ), $editor_id );
+                               $mce_buttons_2 = apply_filters( 'mce_buttons_2', $mce_buttons_2, $editor_id );
 
                                /**
                                 * Filter the third-row list of TinyMCE buttons (Visual tab).
@@ -1245,7 +1244,7 @@ final class _WP_Editors {
                $width = isset( $content_width ) && 800 > $content_width ? $content_width : 800;
                $width = $width + 22; // compensate for the padding and border
                $dfw_width = get_user_setting( 'dfw_width', $width );
-               $save = isset( $post->post_status ) && $post->post_status == 'publish' ? __('Update') : __('Save');
+               $save = $post && $post->post_status == 'publish' ? __('Update') : __('Save');
 
                ?>
                <div id="wp-fullscreen-body" class="wp-core-ui<?php if ( is_rtl() ) echo ' rtl'; ?>" data-theme-width="<?php echo (int) $width; ?>" data-dfw-width="<?php echo (int) $dfw_width; ?>">
@@ -1310,7 +1309,7 @@ final class _WP_Editors {
 
                <div id="wp-fullscreen-save">
                        <input type="button" class="button button-primary right" value="<?php echo $save; ?>" onclick="wp.editor.fullscreen.save();" />
-                       <span class="wp-fullscreen-saved-message"><?php if ( $post->post_status == 'publish' ) _e('Updated.'); else _e('Saved.'); ?></span>
+                       <span class="wp-fullscreen-saved-message"><?php if ( $post && $post->post_status == 'publish' ) _e('Updated.'); else _e('Saved.'); ?></span>
                        <span class="wp-fullscreen-error-message"><?php _e('Save failed.'); ?></span>
                        <span class="spinner"></span>
                </div>
@@ -1442,13 +1441,13 @@ final class _WP_Editors {
                        <div id="link-options">
                                <p class="howto"><?php _e( 'Enter the destination URL' ); ?></p>
                                <div>
-                                       <label><span><?php _e( 'URL' ); ?></span><input id="url-field" type="text" name="href" /></label>
+                                       <label><span><?php _e( 'URL' ); ?></span><input id="wp-link-url" type="text" /></label>
                                </div>
-                               <div>
-                                       <label><span><?php _e( 'Title' ); ?></span><input id="link-title-field" type="text" name="linktitle" /></label>
+                               <div class="wp-link-text-field">
+                                       <label><span><?php _e( 'Link Text' ); ?></span><input id="wp-link-text" type="text" /></label>
                                </div>
                                <div class="link-target">
-                                       <label><span>&nbsp;</span><input type="checkbox" id="link-target-checkbox" /> <?php _e( 'Open link in a new window/tab' ); ?></label>
+                                       <label><span>&nbsp;</span><input type="checkbox" id="wp-link-target" /> <?php _e( 'Open link in a new window/tab' ); ?></label>
                                </div>
                        </div>
                        <p class="howto"><a href="#" id="wp-link-search-toggle"><?php _e( 'Or link to existing content' ); ?></a></p>
@@ -1456,7 +1455,7 @@ final class _WP_Editors {
                                <div class="link-search-wrapper">
                                        <label>
                                                <span class="search-label"><?php _e( 'Search' ); ?></span>
-                                               <input type="search" id="search-field" class="link-search-field" autocomplete="off" />
+                                               <input type="search" id="wp-link-search" class="link-search-field" autocomplete="off" />
                                                <span class="spinner"></span>
                                        </label>
                                </div>