X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/9e77185fafaf4e60e2b73821e0e4b9b1a11fb85f..refs/tags/wordpress-4.1-scripts:/wp-admin/edit-form-advanced.php diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index ebda7a3f..a9222ce6 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -11,20 +11,23 @@ if ( !defined('ABSPATH') ) die('-1'); wp_enqueue_script('post'); -$_wp_editor_expand = false; +$_wp_editor_expand = $_content_editor_dfw = false; /** * Filter whether to enable the 'expand' functionality in the post editor. * * @since 4.0.0 + * @since 4.1.0 Added the `$post_type` parameter. * - * @param bool $expand Whether to enable the 'expand' functionality. Default true. + * @param bool $expand Whether to enable the 'expand' functionality. Default true. + * @param string $post_type Post type. */ if ( post_type_supports( $post_type, 'editor' ) && ! wp_is_mobile() && ! ( $is_IE && preg_match( '/MSIE [5678]/', $_SERVER['HTTP_USER_AGENT'] ) ) && - apply_filters( 'wp_editor_expand', true ) ) { + apply_filters( 'wp_editor_expand', true, $post_type ) ) { wp_enqueue_script('editor-expand'); + $_content_editor_dfw = true; $_wp_editor_expand = ( get_user_setting( 'editor_expand', 'on' ) === 'on' ); } @@ -241,7 +244,7 @@ do_action( 'add_meta_boxes', $post_type, $post ); /** * Fires after all built-in meta boxes have been added, contextually for the given post type. * - * The dynamic portion of the hook, $post_type, refers to the post type of the post. + * The dynamic portion of the hook, `$post_type`, refers to the post type of the post. * * @since 3.0.0 * @@ -278,7 +281,11 @@ if ( 'post' == $post_type ) { ) ); $title_and_editor = '

' . __('Title - Enter a title for your post. After you enter a title, you’ll see the permalink below, which you can edit.') . '

'; - $title_and_editor .= '

' . __('Post editor - 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.') . '

'; + $title_and_editor .= '

' . __( 'Post editor - Enter the text for your post. There are two modes of editing: Visual and Text. Choose the mode by clicking on the appropriate tab.' ) . '

'; + $title_and_editor .= '

' . __( 'Visual mode gives you a WYSIWYG editor. Click the last icon in the row to get a second row of controls. ') . '

'; + $title_and_editor .= '

' . __( 'The Text mode allows you to enter HTML along with your post text. Line breaks will be converted to paragraphs automatically.' ) . '

'; + $title_and_editor .= '

' . __( 'You can insert media files by clicking the icons above the post editor and following the directions. You can align or edit images using the inline formatting toolbar available in Visual mode.' ) . '

'; + $title_and_editor .= '

' . __( 'You can enable distraction-free writing mode using the icon to the right. This feature is not available for old browsers or devices with small screens, and requires that the full-height editor be enabled in Screen Options.' ) . '

'; $title_and_editor .= '

' . __( 'Keyboard users: When you’re working in the visual editor, you can use Alt + F10 to access the toolbar.' ) . '

'; get_current_screen()->add_help_tab( array( @@ -388,7 +395,7 @@ if ( isset( $post_new_file ) && current_user_can( $post_type_object->cap->create echo ' ' . esc_html( $post_type_object->labels->add_new ) . ''; ?> -

+

@@ -398,16 +405,16 @@ if ( isset( $post_new_file ) && current_user_can( $post_type_object->cap->create

- tag. + * Fires inside the post editor form tag. * * @since 3.0.0 * * @param WP_Post $post Post object. */ -?> -
> +do_action( 'post_edit_form_tag', $post ); +?>> @@ -457,10 +464,21 @@ do_action( 'edit_form_top', $post ); ?> * @param string $text Placeholder text. Default 'Enter title here'. * @param WP_Post $post Post object. */ + $title_placeholder = apply_filters( 'enter_title_here', __( 'Enter title here' ), $post ); ?> - - + + +
public ? get_sample_permalink_html($post->ID) : ''; @@ -502,9 +520,9 @@ if ( post_type_supports($post_type, 'editor') ) {
post_content, 'content', array( - 'dfw' => true, + '_content_editor_dfw' => $_content_editor_dfw, 'drag_drop_upload' => true, - 'tabfocus_elements' => 'insert-media-button,save-post', + 'tabfocus_elements' => 'content-html,save-post', 'editor_height' => 300, 'tinymce' => array( 'resize' => false, @@ -629,7 +647,7 @@ if ( post_type_supports( $post_type, 'comments' ) ) wp_comment_reply(); ?> -post_title ) : ?> +post_title ) : ?>