wp/wp-admin/edit-form-advanced.php
changeset 22 8c2e4d02f4ef
parent 21 48c4eec2b7e6
equal deleted inserted replaced
21:48c4eec2b7e6 22:8c2e4d02f4ef
    23 $current_screen->is_block_editor( false );
    23 $current_screen->is_block_editor( false );
    24 
    24 
    25 if ( is_multisite() ) {
    25 if ( is_multisite() ) {
    26 	add_action( 'admin_footer', '_admin_notice_post_locked' );
    26 	add_action( 'admin_footer', '_admin_notice_post_locked' );
    27 } else {
    27 } else {
    28 	$check_users = get_users(
    28 	if ( get_user_count() > 1 ) {
    29 		array(
       
    30 			'fields' => 'ID',
       
    31 			'number' => 2,
       
    32 		)
       
    33 	);
       
    34 
       
    35 	if ( count( $check_users ) > 1 ) {
       
    36 		add_action( 'admin_footer', '_admin_notice_post_locked' );
    29 		add_action( 'admin_footer', '_admin_notice_post_locked' );
    37 	}
    30 	}
    38 
    31 
    39 	unset( $check_users );
    32 	unset( $check_users );
    40 }
    33 }
   288 			'content' => $customize_display,
   281 			'content' => $customize_display,
   289 		)
   282 		)
   290 	);
   283 	);
   291 
   284 
   292 	$title_and_editor  = '<p>' . __( '<strong>Title</strong> &mdash; Enter a title for your post. After you enter a title, you&#8217;ll see the permalink below, which you can edit.' ) . '</p>';
   285 	$title_and_editor  = '<p>' . __( '<strong>Title</strong> &mdash; Enter a title for your post. After you enter a title, you&#8217;ll see the permalink below, which you can edit.' ) . '</p>';
   293 	$title_and_editor .= '<p>' . __( '<strong>Post editor</strong> &mdash; Enter the text for your post. There are two modes of editing: Visual and Text. Choose the mode by clicking on the appropriate tab.' ) . '</p>';
   286 	$title_and_editor .= '<p>' . __( '<strong>Post editor</strong> &mdash; Enter the text for your post. There are two modes of editing: Visual and Code. Choose the mode by clicking on the appropriate tab.' ) . '</p>';
   294 	$title_and_editor .= '<p>' . __( 'Visual mode gives you an editor that is similar to a word processor. Click the Toolbar Toggle button to get a second row of controls.' ) . '</p>';
   287 	$title_and_editor .= '<p>' . __( 'Visual mode gives you an editor that is similar to a word processor. Click the Toolbar Toggle button to get a second row of controls.' ) . '</p>';
   295 	$title_and_editor .= '<p>' . __( 'The Text mode allows you to enter HTML along with your post text. Note that &lt;p&gt; and &lt;br&gt; tags are converted to line breaks when switching to the Text editor to make it less cluttered. When you type, a single line break can be used instead of typing &lt;br&gt;, and two line breaks instead of paragraph tags. The line breaks are converted back to tags automatically.' ) . '</p>';
   288 	$title_and_editor .= '<p>' . __( 'The Code mode allows you to enter HTML along with your post text. Note that &lt;p&gt; and &lt;br&gt; tags are converted to line breaks when switching to the Code editor to make it less cluttered. When you type, a single line break can be used instead of typing &lt;br&gt;, and two line breaks instead of paragraph tags. The line breaks are converted back to tags automatically.' ) . '</p>';
   296 	$title_and_editor .= '<p>' . __( 'You can insert media files by clicking the button above the post editor and following the directions. You can align or edit images using the inline formatting toolbar available in Visual mode.' ) . '</p>';
   289 	$title_and_editor .= '<p>' . __( 'You can insert media files by clicking the button above the post editor and following the directions. You can align or edit images using the inline formatting toolbar available in Visual mode.' ) . '</p>';
   297 	$title_and_editor .= '<p>' . __( '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.' ) . '</p>';
   290 	$title_and_editor .= '<p>' . __( '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.' ) . '</p>';
   298 	$title_and_editor .= '<p>' . sprintf(
   291 	$title_and_editor .= '<p>' . sprintf(
   299 		/* translators: %s: Alt + F10 */
   292 		/* translators: %s: Alt + F10 */
   300 		__( 'Keyboard users: When you are working in the visual editor, you can use %s to access the toolbar.' ),
   293 		__( 'Keyboard users: When you are working in the visual editor, you can use %s to access the toolbar.' ),
   319 			'<p>' . __( '<a href="https://wordpress.org/documentation/article/write-posts-classic-editor/">Documentation on Writing and Editing Posts</a>' ) . '</p>' .
   312 			'<p>' . __( '<a href="https://wordpress.org/documentation/article/write-posts-classic-editor/">Documentation on Writing and Editing Posts</a>' ) . '</p>' .
   320 			'<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>'
   313 			'<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>'
   321 	);
   314 	);
   322 } elseif ( 'page' === $post_type ) {
   315 } elseif ( 'page' === $post_type ) {
   323 	$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>' .
   316 	$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>' .
   324 		'<p>' . __( 'Creating a Page is very similar to creating a Post, and the screens can be customized in the same way using drag and drop, the Screen Options tab, and expanding/collapsing boxes as you choose. This screen also has the distraction-free writing space, available in both the Visual and Text modes via the Fullscreen buttons. The Page editor mostly works the same as the Post editor, but there are some Page-specific features in the Page Attributes box.' ) . '</p>';
   317 		'<p>' . __( 'Creating a Page is very similar to creating a Post, and the screens can be customized in the same way using drag and drop, the Screen Options tab, and expanding/collapsing boxes as you choose. This screen also has the distraction-free writing space, available in both the Visual and Code modes via the Fullscreen buttons. The Page editor mostly works the same as the Post editor, but there are some Page-specific features in the Page Attributes box.' ) . '</p>';
   325 
   318 
   326 	get_current_screen()->add_help_tab(
   319 	get_current_screen()->add_help_tab(
   327 		array(
   320 		array(
   328 			'id'      => 'about-pages',
   321 			'id'      => 'about-pages',
   329 			'title'   => __( 'About Pages' ),
   322 			'title'   => __( 'About Pages' ),
   432 ?>
   425 ?>
   433 </h1>
   426 </h1>
   434 
   427 
   435 <?php
   428 <?php
   436 if ( isset( $post_new_file ) && current_user_can( $post_type_object->cap->create_posts ) ) {
   429 if ( isset( $post_new_file ) && current_user_can( $post_type_object->cap->create_posts ) ) {
   437 	echo ' <a href="' . esc_url( admin_url( $post_new_file ) ) . '" class="page-title-action">' . esc_html( $post_type_object->labels->add_new ) . '</a>';
   430 	echo ' <a href="' . esc_url( admin_url( $post_new_file ) ) . '" class="page-title-action">' . esc_html( $post_type_object->labels->add_new_item ) . '</a>';
   438 }
   431 }
   439 ?>
   432 ?>
   440 
   433 
   441 <hr class="wp-header-end">
   434 <hr class="wp-header-end">
   442 
   435 
   544 	 */
   537 	 */
   545 	$title_placeholder = apply_filters( 'enter_title_here', __( 'Add title' ), $post );
   538 	$title_placeholder = apply_filters( 'enter_title_here', __( 'Add title' ), $post );
   546 	?>
   539 	?>
   547 	<label class="screen-reader-text" id="title-prompt-text" for="title"><?php echo $title_placeholder; ?></label>
   540 	<label class="screen-reader-text" id="title-prompt-text" for="title"><?php echo $title_placeholder; ?></label>
   548 	<input type="text" name="post_title" size="30" value="<?php echo esc_attr( $post->post_title ); ?>" id="title" spellcheck="true" autocomplete="off" />
   541 	<input type="text" name="post_title" size="30" value="<?php echo esc_attr( $post->post_title ); ?>" id="title" spellcheck="true" autocomplete="off" />
       
   542 	<?php
       
   543 	if ( post_type_supports( $post_type, 'editor' ) ) {
       
   544 		?>
       
   545 		<a href="#content" class="button-secondary screen-reader-text skiplink" onclick="if (tinymce) { tinymce.execCommand( 'mceFocus', false, 'content' ); }"><?php esc_html_e( 'Skip to Editor' ); ?></a>
       
   546 		<?php
       
   547 	}
       
   548 	?>
   549 </div>
   549 </div>
   550 	<?php
   550 	<?php
   551 	/**
   551 	/**
   552 	 * Fires before the permalink field in the edit form.
   552 	 * Fires before the permalink field in the edit form.
   553 	 *
   553 	 *
   619 		$post->post_content,
   619 		$post->post_content,
   620 		'content',
   620 		'content',
   621 		array(
   621 		array(
   622 			'_content_editor_dfw' => $_content_editor_dfw,
   622 			'_content_editor_dfw' => $_content_editor_dfw,
   623 			'drag_drop_upload'    => true,
   623 			'drag_drop_upload'    => true,
   624 			'tabfocus_elements'   => 'content-html,save-post',
       
   625 			'editor_height'       => 300,
   624 			'editor_height'       => 300,
   626 			'tinymce'             => array(
   625 			'tinymce'             => array(
   627 				'resize'                  => false,
   626 				'resize'             => false,
   628 				'wp_autoresize_on'        => $_wp_editor_expand,
   627 				'wp_autoresize_on'   => $_wp_editor_expand,
   629 				'add_unload_trigger'      => false,
   628 				'add_unload_trigger' => false,
   630 				'wp_keep_scroll_position' => ! $is_IE,
       
   631 			),
   629 			),
   632 		)
   630 		)
   633 	);
   631 	);
   634 	?>
   632 	?>
   635 <table id="post-status-info"><tbody><tr>
   633 <table id="post-status-info" role="presentation"><tbody><tr>
   636 	<td id="wp-word-count" class="hide-if-no-js">
   634 	<td id="wp-word-count" class="hide-if-no-js">
   637 	<?php
   635 	<?php
   638 	printf(
   636 	printf(
   639 		/* translators: %s: Number of words. */
   637 		/* translators: %s: Number of words. */
   640 		__( 'Word count: %s' ),
   638 		__( 'Word count: %s' ),