wp/wp-admin/includes/meta-boxes.php
changeset 21 48c4eec2b7e6
parent 19 3d72ae0968f4
child 22 8c2e4d02f4ef
equal deleted inserted replaced
20:7b1b88e27a20 21:48c4eec2b7e6
    74 				}
    74 				}
    75 
    75 
    76 				$preview_button = sprintf(
    76 				$preview_button = sprintf(
    77 					'%1$s<span class="screen-reader-text"> %2$s</span>',
    77 					'%1$s<span class="screen-reader-text"> %2$s</span>',
    78 					$preview_button_text,
    78 					$preview_button_text,
    79 					/* translators: Accessibility text. */
    79 					/* translators: Hidden accessibility text. */
    80 					__( '(opens in a new tab)' )
    80 					__( '(opens in a new tab)' )
    81 				);
    81 				);
    82 				?>
    82 				?>
    83 				<a class="preview button" href="<?php echo $preview_link; ?>" target="wp-preview-<?php echo $post_id; ?>" id="post-preview"><?php echo $preview_button; ?></a>
    83 				<a class="preview button" href="<?php echo $preview_link; ?>" target="wp-preview-<?php echo $post_id; ?>" id="post-preview"><?php echo $preview_button; ?></a>
    84 				<input type="hidden" name="wp-preview" id="wp-preview" value="" />
    84 				<input type="hidden" name="wp-preview" id="wp-preview" value="" />
   130 				$private_style = '';
   130 				$private_style = '';
   131 				if ( 'private' === $post->post_status ) {
   131 				if ( 'private' === $post->post_status ) {
   132 					$private_style = 'style="display:none"';
   132 					$private_style = 'style="display:none"';
   133 				}
   133 				}
   134 				?>
   134 				?>
   135 				<a href="#post_status" <?php echo $private_style; ?> class="edit-post-status hide-if-no-js" role="button"><span aria-hidden="true"><?php _e( 'Edit' ); ?></span> <span class="screen-reader-text"><?php _e( 'Edit status' ); ?></span></a>
   135 				<a href="#post_status" <?php echo $private_style; ?> class="edit-post-status hide-if-no-js" role="button"><span aria-hidden="true"><?php _e( 'Edit' ); ?></span> <span class="screen-reader-text">
       
   136 					<?php
       
   137 					/* translators: Hidden accessibility text. */
       
   138 					_e( 'Edit status' );
       
   139 					?>
       
   140 				</span></a>
   136 
   141 
   137 				<div id="post-status-select" class="hide-if-js">
   142 				<div id="post-status-select" class="hide-if-js">
   138 					<input type="hidden" name="hidden_post_status" id="hidden_post_status" value="<?php echo esc_attr( ( 'auto-draft' === $post->post_status ) ? 'draft' : $post->post_status ); ?>" />
   143 					<input type="hidden" name="hidden_post_status" id="hidden_post_status" value="<?php echo esc_attr( ( 'auto-draft' === $post->post_status ) ? 'draft' : $post->post_status ); ?>" />
   139 					<label for="post_status" class="screen-reader-text"><?php _e( 'Set status' ); ?></label>
   144 					<label for="post_status" class="screen-reader-text">
       
   145 						<?php
       
   146 						/* translators: Hidden accessibility text. */
       
   147 						_e( 'Set status' );
       
   148 						?>
       
   149 					</label>
   140 					<select name="post_status" id="post_status">
   150 					<select name="post_status" id="post_status">
   141 						<?php if ( 'publish' === $post->post_status ) : ?>
   151 						<?php if ( 'publish' === $post->post_status ) : ?>
   142 							<option<?php selected( $post->post_status, 'publish' ); ?> value='publish'><?php _e( 'Published' ); ?></option>
   152 							<option<?php selected( $post->post_status, 'publish' ); ?> value='publish'><?php _e( 'Published' ); ?></option>
   143 						<?php elseif ( 'private' === $post->post_status ) : ?>
   153 						<?php elseif ( 'private' === $post->post_status ) : ?>
   144 							<option<?php selected( $post->post_status, 'private' ); ?> value='publish'><?php _e( 'Privately Published' ); ?></option>
   154 							<option<?php selected( $post->post_status, 'private' ); ?> value='publish'><?php _e( 'Privately Published' ); ?></option>
   182 				echo esc_html( $visibility_trans );
   192 				echo esc_html( $visibility_trans );
   183 				?>
   193 				?>
   184 			</span>
   194 			</span>
   185 
   195 
   186 			<?php if ( $can_publish ) { ?>
   196 			<?php if ( $can_publish ) { ?>
   187 				<a href="#visibility" class="edit-visibility hide-if-no-js" role="button"><span aria-hidden="true"><?php _e( 'Edit' ); ?></span> <span class="screen-reader-text"><?php _e( 'Edit visibility' ); ?></span></a>
   197 				<a href="#visibility" class="edit-visibility hide-if-no-js" role="button"><span aria-hidden="true"><?php _e( 'Edit' ); ?></span> <span class="screen-reader-text">
       
   198 					<?php
       
   199 					/* translators: Hidden accessibility text. */
       
   200 					_e( 'Edit visibility' );
       
   201 					?>
       
   202 				</span></a>
   188 
   203 
   189 				<div id="post-visibility-select" class="hide-if-js">
   204 				<div id="post-visibility-select" class="hide-if-js">
   190 					<input type="hidden" name="hidden_post_password" id="hidden-post-password" value="<?php echo esc_attr( $post->post_password ); ?>" />
   205 					<input type="hidden" name="hidden_post_password" id="hidden-post-password" value="<?php echo esc_attr( $post->post_password ); ?>" />
   191 					<?php if ( 'post' === $post_type ) : ?>
   206 					<?php if ( 'post' === $post_type ) : ?>
   192 						<input type="checkbox" style="display:none" name="hidden_post_sticky" id="hidden-post-sticky" value="sticky" <?php checked( is_sticky( $post_id ) ); ?> />
   207 						<input type="checkbox" style="display:none" name="hidden_post_sticky" id="hidden-post-sticky" value="sticky" <?php checked( is_sticky( $post_id ) ); ?> />
   255 			<div class="misc-pub-section misc-pub-revisions">
   270 			<div class="misc-pub-section misc-pub-revisions">
   256 				<?php
   271 				<?php
   257 				/* translators: Post revisions heading. %s: The number of available revisions. */
   272 				/* translators: Post revisions heading. %s: The number of available revisions. */
   258 				printf( __( 'Revisions: %s' ), '<b>' . number_format_i18n( $args['args']['revisions_count'] ) . '</b>' );
   273 				printf( __( 'Revisions: %s' ), '<b>' . number_format_i18n( $args['args']['revisions_count'] ) . '</b>' );
   259 				?>
   274 				?>
   260 				<a class="hide-if-no-js" href="<?php echo esc_url( get_edit_post_link( $args['args']['revision_id'] ) ); ?>"><span aria-hidden="true"><?php _ex( 'Browse', 'revisions' ); ?></span> <span class="screen-reader-text"><?php _e( 'Browse revisions' ); ?></span></a>
   275 				<a class="hide-if-no-js" href="<?php echo esc_url( get_edit_post_link( $args['args']['revision_id'] ) ); ?>"><span aria-hidden="true"><?php _ex( 'Browse', 'revisions' ); ?></span> <span class="screen-reader-text">
       
   276 					<?php
       
   277 					/* translators: Hidden accessibility text. */
       
   278 					_e( 'Browse revisions' );
       
   279 					?>
       
   280 				</span></a>
   261 			</div>
   281 			</div>
   262 			<?php
   282 			<?php
   263 		endif;
   283 		endif;
   264 
   284 
   265 		if ( $can_publish ) : // Contributors don't get to choose the date of publish.
   285 		if ( $can_publish ) : // Contributors don't get to choose the date of publish.
   268 				<span id="timestamp">
   288 				<span id="timestamp">
   269 					<?php printf( $stamp, '<b>' . $date . '</b>' ); ?>
   289 					<?php printf( $stamp, '<b>' . $date . '</b>' ); ?>
   270 				</span>
   290 				</span>
   271 				<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" role="button">
   291 				<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" role="button">
   272 					<span aria-hidden="true"><?php _e( 'Edit' ); ?></span>
   292 					<span aria-hidden="true"><?php _e( 'Edit' ); ?></span>
   273 					<span class="screen-reader-text"><?php _e( 'Edit date and time' ); ?></span>
   293 					<span class="screen-reader-text">
       
   294 						<?php
       
   295 						/* translators: Hidden accessibility text. */
       
   296 						_e( 'Edit date and time' );
       
   297 						?>
       
   298 					</span>
   274 				</a>
   299 				</a>
   275 				<fieldset id="timestampdiv" class="hide-if-js">
   300 				<fieldset id="timestampdiv" class="hide-if-js">
   276 					<legend class="screen-reader-text"><?php _e( 'Date and time' ); ?></legend>
   301 					<legend class="screen-reader-text">
       
   302 						<?php
       
   303 						/* translators: Hidden accessibility text. */
       
   304 						_e( 'Date and time' );
       
   305 						?>
       
   306 					</legend>
   277 					<?php touch_time( ( 'edit' === $action ), 1 ); ?>
   307 					<?php touch_time( ( 'edit' === $action ), 1 ); ?>
   278 				</fieldset>
   308 				</fieldset>
   279 			</div>
   309 			</div>
   280 			<?php
   310 			<?php
   281 		endif;
   311 		endif;
   282 
   312 
   283 		if ( 'draft' === $post->post_status && get_post_meta( $post_id, '_customize_changeset_uuid', true ) ) :
   313 		if ( 'draft' === $post->post_status && get_post_meta( $post_id, '_customize_changeset_uuid', true ) ) :
   284 			?>
   314 			$message = sprintf(
   285 			<div class="notice notice-info notice-alt inline">
   315 				/* translators: %s: URL to the Customizer. */
   286 				<p>
   316 				__( 'This draft comes from your <a href="%s">unpublished customization changes</a>. You can edit, but there is no need to publish now. It will be published automatically with those changes.' ),
   287 					<?php
   317 				esc_url(
   288 					printf(
   318 					add_query_arg(
   289 						/* translators: %s: URL to the Customizer. */
   319 						'changeset_uuid',
   290 						__( 'This draft comes from your <a href="%s">unpublished customization changes</a>. You can edit, but there is no need to publish now. It will be published automatically with those changes.' ),
   320 						rawurlencode( get_post_meta( $post_id, '_customize_changeset_uuid', true ) ),
   291 						esc_url(
   321 						admin_url( 'customize.php' )
   292 							add_query_arg(
   322 					)
   293 								'changeset_uuid',
   323 				)
   294 								rawurlencode( get_post_meta( $post_id, '_customize_changeset_uuid', true ) ),
   324 			);
   295 								admin_url( 'customize.php' )
   325 			wp_admin_notice(
   296 							)
   326 				$message,
   297 						)
   327 				array(
   298 					);
   328 					'type'               => 'info',
   299 					?>
   329 					'additional_classes' => array( 'notice-alt', 'inline' ),
   300 				</p>
   330 				)
   301 			</div>
   331 			);
   302 			<?php
       
   303 		endif;
   332 		endif;
   304 
   333 
   305 		/**
   334 		/**
   306 		 * Fires after the post time/date setting in the Publish meta box.
   335 		 * Fires after the post time/date setting in the Publish meta box.
   307 		 *
   336 		 *
   403 <div id="misc-publishing-actions">
   432 <div id="misc-publishing-actions">
   404 	<div class="misc-pub-section curtime misc-pub-curtime">
   433 	<div class="misc-pub-section curtime misc-pub-curtime">
   405 		<span id="timestamp">
   434 		<span id="timestamp">
   406 			<?php
   435 			<?php
   407 			$uploaded_on = sprintf(
   436 			$uploaded_on = sprintf(
   408 				/* translators: Publish box date string. 1: Date, 2: Time. See https://www.php.net/manual/datetime.format.php */
   437 				/* translators: Publish box date string. 1: Date, 2: Time. */
   409 				__( '%1$s at %2$s' ),
   438 				__( '%1$s at %2$s' ),
   410 				/* translators: Publish box date format, see https://www.php.net/manual/datetime.format.php */
   439 				/* translators: Publish box date format, see https://www.php.net/manual/datetime.format.php */
   411 				date_i18n( _x( 'M j, Y', 'publish box date format' ), strtotime( $post->post_date ) ),
   440 				date_i18n( _x( 'M j, Y', 'publish box date format' ), strtotime( $post->post_date ) ),
   412 				/* translators: Publish box time format, see https://www.php.net/manual/datetime.format.php */
   441 				/* translators: Publish box time format, see https://www.php.net/manual/datetime.format.php */
   413 				date_i18n( _x( 'H:i', 'publish box time format' ), strtotime( $post->post_date ) )
   442 				date_i18n( _x( 'H:i', 'publish box time format' ), strtotime( $post->post_date ) )
   437 <div id="major-publishing-actions">
   466 <div id="major-publishing-actions">
   438 	<div id="delete-action">
   467 	<div id="delete-action">
   439 	<?php
   468 	<?php
   440 	if ( current_user_can( 'delete_post', $post->ID ) ) {
   469 	if ( current_user_can( 'delete_post', $post->ID ) ) {
   441 		if ( EMPTY_TRASH_DAYS && MEDIA_TRASH ) {
   470 		if ( EMPTY_TRASH_DAYS && MEDIA_TRASH ) {
   442 			echo "<a class='submitdelete deletion' href='" . get_delete_post_link( $post->ID ) . "'>" . __( 'Move to Trash' ) . '</a>';
   471 			printf(
       
   472 				'<a class="submitdelete deletion" href="%1$s">%2$s</a>',
       
   473 				get_delete_post_link( $post->ID ),
       
   474 				__( 'Move to Trash' )
       
   475 			);
   443 		} else {
   476 		} else {
   444 			$delete_ays = ! MEDIA_TRASH ? " onclick='return showNotice.warn();'" : '';
   477 			$show_confirmation = ! MEDIA_TRASH ? " onclick='return showNotice.warn();'" : '';
   445 			echo "<a class='submitdelete deletion'$delete_ays href='" . get_delete_post_link( $post->ID, null, true ) . "'>" . __( 'Delete permanently' ) . '</a>';
   478 
       
   479 			printf(
       
   480 				'<a class="submitdelete deletion"%1$s href="%2$s">%3$s</a>',
       
   481 				$show_confirmation,
       
   482 				get_delete_post_link( $post->ID, '', true ),
       
   483 				__( 'Delete permanently' )
       
   484 			);
   446 		}
   485 		}
   447 	}
   486 	}
   448 	?>
   487 	?>
   449 	</div>
   488 	</div>
   450 
   489 
   490 				$post_formats[0][] = $post_format;
   529 				$post_formats[0][] = $post_format;
   491 			}
   530 			}
   492 			?>
   531 			?>
   493 		<div id="post-formats-select">
   532 		<div id="post-formats-select">
   494 		<fieldset>
   533 		<fieldset>
   495 			<legend class="screen-reader-text"><?php _e( 'Post Formats' ); ?></legend>
   534 			<legend class="screen-reader-text">
       
   535 				<?php
       
   536 				/* translators: Hidden accessibility text. */
       
   537 				_e( 'Post Formats' );
       
   538 				?>
       
   539 			</legend>
   496 			<input type="radio" name="post_format" class="post-format" id="post-format-0" value="0" <?php checked( $post_format, '0' ); ?> /> <label for="post-format-0" class="post-format-icon post-format-standard"><?php echo get_post_format_string( 'standard' ); ?></label>
   540 			<input type="radio" name="post_format" class="post-format" id="post-format-0" value="0" <?php checked( $post_format, '0' ); ?> /> <label for="post-format-0" class="post-format-icon post-format-standard"><?php echo get_post_format_string( 'standard' ); ?></label>
   497 			<?php foreach ( $post_formats[0] as $format ) : ?>
   541 			<?php foreach ( $post_formats[0] as $format ) : ?>
   498 			<br /><input type="radio" name="post_format" class="post-format" id="post-format-<?php echo esc_attr( $format ); ?>" value="<?php echo esc_attr( $format ); ?>" <?php checked( $post_format, $format ); ?> /> <label for="post-format-<?php echo esc_attr( $format ); ?>" class="post-format-icon post-format-<?php echo esc_attr( $format ); ?>"><?php echo esc_html( get_post_format_string( $format ) ); ?></label>
   542 			<br /><input type="radio" name="post_format" class="post-format" id="post-format-<?php echo esc_attr( $format ); ?>" value="<?php echo esc_attr( $format ); ?>" <?php checked( $post_format, $format ); ?> /> <label for="post-format-<?php echo esc_attr( $format ); ?>" class="post-format-icon post-format-<?php echo esc_attr( $format ); ?>"><?php echo esc_html( get_post_format_string( $format ) ); ?></label>
   499 			<?php endforeach; ?>
   543 			<?php endforeach; ?>
   500 		</fieldset>
   544 		</fieldset>
   698  *
   742  *
   699  * @param WP_Post $post Current post object.
   743  * @param WP_Post $post Current post object.
   700  */
   744  */
   701 function post_excerpt_meta_box( $post ) {
   745 function post_excerpt_meta_box( $post ) {
   702 	?>
   746 	?>
   703 <label class="screen-reader-text" for="excerpt"><?php _e( 'Excerpt' ); ?></label><textarea rows="1" cols="40" name="excerpt" id="excerpt"><?php echo $post->post_excerpt; // textarea_escaped ?></textarea>
   747 <label class="screen-reader-text" for="excerpt">
       
   748 	<?php
       
   749 	/* translators: Hidden accessibility text. */
       
   750 	_e( 'Excerpt' );
       
   751 	?>
       
   752 </label><textarea rows="1" cols="40" name="excerpt" id="excerpt"><?php echo $post->post_excerpt; // textarea_escaped ?></textarea>
   704 <p>
   753 <p>
   705 	<?php
   754 	<?php
   706 	printf(
   755 	printf(
   707 		/* translators: %s: Documentation URL. */
   756 		/* translators: %s: Documentation URL. */
   708 		__( 'Excerpts are optional hand-crafted summaries of your content that can be used in your theme. <a href="%s">Learn more about manual excerpts</a>.' ),
   757 		__( 'Excerpts are optional hand-crafted summaries of your content that can be used in your theme. <a href="%s">Learn more about manual excerpts</a>.' ),
   709 		__( 'https://wordpress.org/support/article/excerpt/' )
   758 		__( 'https://wordpress.org/documentation/article/what-is-an-excerpt-classic-editor/' )
   710 	);
   759 	);
   711 	?>
   760 	?>
   712 </p>
   761 </p>
   713 	<?php
   762 	<?php
   714 }
   763 }
   742 <p>
   791 <p>
   743 	<?php
   792 	<?php
   744 	printf(
   793 	printf(
   745 		/* translators: %s: Documentation URL. */
   794 		/* translators: %s: Documentation URL. */
   746 		__( 'Trackbacks are a way to notify legacy blog systems that you&#8217;ve linked to them. If you link other WordPress sites, they&#8217;ll be notified automatically using <a href="%s">pingbacks</a>, no other action necessary.' ),
   795 		__( 'Trackbacks are a way to notify legacy blog systems that you&#8217;ve linked to them. If you link other WordPress sites, they&#8217;ll be notified automatically using <a href="%s">pingbacks</a>, no other action necessary.' ),
   747 		__( 'https://wordpress.org/support/article/introduction-to-blogging/#comments' )
   796 		__( 'https://wordpress.org/documentation/article/introduction-to-blogging/#comments' )
   748 	);
   797 	);
   749 	?>
   798 	?>
   750 </p>
   799 </p>
   751 	<?php
   800 	<?php
   752 	if ( ! empty( $pings ) ) {
   801 	if ( ! empty( $pings ) ) {
   779 <p>
   828 <p>
   780 	<?php
   829 	<?php
   781 	printf(
   830 	printf(
   782 		/* translators: %s: Documentation URL. */
   831 		/* translators: %s: Documentation URL. */
   783 		__( 'Custom fields can be used to add extra metadata to a post that you can <a href="%s">use in your theme</a>.' ),
   832 		__( 'Custom fields can be used to add extra metadata to a post that you can <a href="%s">use in your theme</a>.' ),
   784 		__( 'https://wordpress.org/support/article/custom-fields/' )
   833 		__( 'https://wordpress.org/documentation/article/assign-custom-fields/' )
   785 	);
   834 	);
   786 	?>
   835 	?>
   787 </p>
   836 </p>
   788 	<?php
   837 	<?php
   789 }
   838 }
   802 	<label for="comment_status" class="selectit"><input name="comment_status" type="checkbox" id="comment_status" value="open" <?php checked( $post->comment_status, 'open' ); ?> /> <?php _e( 'Allow comments' ); ?></label><br />
   851 	<label for="comment_status" class="selectit"><input name="comment_status" type="checkbox" id="comment_status" value="open" <?php checked( $post->comment_status, 'open' ); ?> /> <?php _e( 'Allow comments' ); ?></label><br />
   803 	<label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked( $post->ping_status, 'open' ); ?> />
   852 	<label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked( $post->ping_status, 'open' ); ?> />
   804 		<?php
   853 		<?php
   805 		printf(
   854 		printf(
   806 			/* translators: %s: Documentation URL. */
   855 			/* translators: %s: Documentation URL. */
   807 			__( 'Allow <a href="%s">trackbacks and pingbacks</a> on this page' ),
   856 			__( 'Allow <a href="%s">trackbacks and pingbacks</a>' ),
   808 			__( 'https://wordpress.org/support/article/introduction-to-blogging/#managing-comments' )
   857 			__( 'https://wordpress.org/documentation/article/introduction-to-blogging/#managing-comments' )
   809 		);
   858 		);
   810 		?>
   859 		?>
   811 	</label>
   860 	</label>
   812 	<?php
   861 	<?php
   813 	/**
   862 	/**
   850 	<?php
   899 	<?php
   851 
   900 
   852 	$total         = get_comments(
   901 	$total         = get_comments(
   853 		array(
   902 		array(
   854 			'post_id' => $post->ID,
   903 			'post_id' => $post->ID,
   855 			'number'  => 1,
       
   856 			'count'   => true,
   904 			'count'   => true,
       
   905 			'orderby' => 'none',
   857 		)
   906 		)
   858 	);
   907 	);
   859 	$wp_list_table = _get_list_table( 'WP_Post_Comments_List_Table' );
   908 	$wp_list_table = _get_list_table( 'WP_Post_Comments_List_Table' );
   860 	$wp_list_table->display( true );
   909 	$wp_list_table->display( true );
   861 
   910 
   886  */
   935  */
   887 function post_slug_meta_box( $post ) {
   936 function post_slug_meta_box( $post ) {
   888 	/** This filter is documented in wp-admin/edit-tag-form.php */
   937 	/** This filter is documented in wp-admin/edit-tag-form.php */
   889 	$editable_slug = apply_filters( 'editable_slug', $post->post_name, $post );
   938 	$editable_slug = apply_filters( 'editable_slug', $post->post_name, $post );
   890 	?>
   939 	?>
   891 <label class="screen-reader-text" for="post_name"><?php _e( 'Slug' ); ?></label><input name="post_name" type="text" size="13" id="post_name" value="<?php echo esc_attr( $editable_slug ); ?>" />
   940 <label class="screen-reader-text" for="post_name">
       
   941 	<?php
       
   942 	/* translators: Hidden accessibility text. */
       
   943 	_e( 'Slug' );
       
   944 	?>
       
   945 </label><input name="post_name" type="text" class="large-text" id="post_name" value="<?php echo esc_attr( $editable_slug ); ?>" />
   892 	<?php
   946 	<?php
   893 }
   947 }
   894 
   948 
   895 /**
   949 /**
   896  * Displays form field with list of authors.
   950  * Displays form field with list of authors.
   904 function post_author_meta_box( $post ) {
   958 function post_author_meta_box( $post ) {
   905 	global $user_ID;
   959 	global $user_ID;
   906 
   960 
   907 	$post_type_object = get_post_type_object( $post->post_type );
   961 	$post_type_object = get_post_type_object( $post->post_type );
   908 	?>
   962 	?>
   909 <label class="screen-reader-text" for="post_author_override"><?php _e( 'Author' ); ?></label>
   963 <label class="screen-reader-text" for="post_author_override">
       
   964 	<?php
       
   965 	/* translators: Hidden accessibility text. */
       
   966 	_e( 'Author' );
       
   967 	?>
       
   968 </label>
   910 	<?php
   969 	<?php
   911 	wp_dropdown_users(
   970 	wp_dropdown_users(
   912 		array(
   971 		array(
   913 			'capability'       => array( $post_type_object->cap->edit_posts ),
   972 			'capability'       => array( $post_type_object->cap->edit_posts ),
   914 			'name'             => 'post_author_override',
   973 			'name'             => 'post_author_override',
   971 			<?php echo $pages; ?>
  1030 			<?php echo $pages; ?>
   972 			<?php
  1031 			<?php
   973 		endif; // End empty pages check.
  1032 		endif; // End empty pages check.
   974 	endif;  // End hierarchical check.
  1033 	endif;  // End hierarchical check.
   975 
  1034 
   976 	if ( count( get_page_templates( $post ) ) > 0 && get_option( 'page_for_posts' ) != $post->ID ) :
  1035 	if ( count( get_page_templates( $post ) ) > 0 && (int) get_option( 'page_for_posts' ) !== $post->ID ) :
   977 		$template = ! empty( $post->page_template ) ? $post->page_template : false;
  1036 		$template = ! empty( $post->page_template ) ? $post->page_template : false;
   978 		?>
  1037 		?>
   979 <p class="post-attributes-label-wrapper page-template-label-wrapper"><label class="post-attributes-label" for="page_template"><?php _e( 'Template' ); ?></label>
  1038 <p class="post-attributes-label-wrapper page-template-label-wrapper"><label class="post-attributes-label" for="page_template"><?php _e( 'Template' ); ?></label>
   980 		<?php
  1039 		<?php
   981 		/**
  1040 		/**
  1141 	</div>
  1200 	</div>
  1142 
  1201 
  1143 	<div id="category-adder" class="wp-hidden-children">
  1202 	<div id="category-adder" class="wp-hidden-children">
  1144 		<a id="category-add-toggle" href="#category-add" class="taxonomy-add-new"><?php _e( '+ Add New Category' ); ?></a>
  1203 		<a id="category-add-toggle" href="#category-add" class="taxonomy-add-new"><?php _e( '+ Add New Category' ); ?></a>
  1145 		<p id="link-category-add" class="wp-hidden-child">
  1204 		<p id="link-category-add" class="wp-hidden-child">
  1146 			<label class="screen-reader-text" for="newcat"><?php _e( '+ Add New Category' ); ?></label>
  1205 			<label class="screen-reader-text" for="newcat">
       
  1206 				<?php
       
  1207 				/* translators: Hidden accessibility text. */
       
  1208 				_e( '+ Add New Category' );
       
  1209 				?>
       
  1210 			</label>
  1147 			<input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php esc_attr_e( 'New category name' ); ?>" aria-required="true" />
  1211 			<input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php esc_attr_e( 'New category name' ); ?>" aria-required="true" />
  1148 			<input type="button" id="link-category-add-submit" data-wp-lists="add:categorychecklist:link-category-add" class="button" value="<?php esc_attr_e( 'Add' ); ?>" />
  1212 			<input type="button" id="link-category-add-submit" data-wp-lists="add:categorychecklist:link-category-add" class="button" value="<?php esc_attr_e( 'Add' ); ?>" />
  1149 			<?php wp_nonce_field( 'add-link-category', '_ajax_nonce', false ); ?>
  1213 			<?php wp_nonce_field( 'add-link-category', '_ajax_nonce', false ); ?>
  1150 			<span id="category-ajax-response"></span>
  1214 			<span id="category-ajax-response"></span>
  1151 		</p>
  1215 		</p>
  1162  * @param object $link Current link object.
  1226  * @param object $link Current link object.
  1163  */
  1227  */
  1164 function link_target_meta_box( $link ) {
  1228 function link_target_meta_box( $link ) {
  1165 
  1229 
  1166 	?>
  1230 	?>
  1167 <fieldset><legend class="screen-reader-text"><span><?php _e( 'Target' ); ?></span></legend>
  1231 <fieldset><legend class="screen-reader-text"><span>
       
  1232 	<?php
       
  1233 	/* translators: Hidden accessibility text. */
       
  1234 	_e( 'Target' );
       
  1235 	?>
       
  1236 </span></legend>
  1168 <p><label for="link_target_blank" class="selectit">
  1237 <p><label for="link_target_blank" class="selectit">
  1169 <input id="link_target_blank" type="radio" name="link_target" value="_blank" <?php echo ( isset( $link->link_target ) && ( '_blank' === $link->link_target ) ? 'checked="checked"' : '' ); ?> />
  1238 <input id="link_target_blank" type="radio" name="link_target" value="_blank" <?php echo ( isset( $link->link_target ) && ( '_blank' === $link->link_target ) ? 'checked="checked"' : '' ); ?> />
  1170 	<?php _e( '<code>_blank</code> &mdash; new window or tab.' ); ?></label></p>
  1239 	<?php _e( '<code>_blank</code> &mdash; new window or tab.' ); ?></label></p>
  1171 <p><label for="link_target_top" class="selectit">
  1240 <p><label for="link_target_top" class="selectit">
  1172 <input id="link_target_top" type="radio" name="link_target" value="_top" <?php echo ( isset( $link->link_target ) && ( '_top' === $link->link_target ) ? 'checked="checked"' : '' ); ?> />
  1241 <input id="link_target_top" type="radio" name="link_target" value="_top" <?php echo ( isset( $link->link_target ) && ( '_top' === $link->link_target ) ? 'checked="checked"' : '' ); ?> />
  1252 		<th scope="row"><label for="link_rel"><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'rel:' ); ?></label></th>
  1321 		<th scope="row"><label for="link_rel"><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'rel:' ); ?></label></th>
  1253 		<td><input type="text" name="link_rel" id="link_rel" value="<?php echo ( isset( $link->link_rel ) ? esc_attr( $link->link_rel ) : '' ); ?>" /></td>
  1322 		<td><input type="text" name="link_rel" id="link_rel" value="<?php echo ( isset( $link->link_rel ) ? esc_attr( $link->link_rel ) : '' ); ?>" /></td>
  1254 	</tr>
  1323 	</tr>
  1255 	<tr>
  1324 	<tr>
  1256 		<th scope="row"><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'identity' ); ?></th>
  1325 		<th scope="row"><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'identity' ); ?></th>
  1257 		<td><fieldset><legend class="screen-reader-text"><span><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'identity' ); ?></span></legend>
  1326 		<td><fieldset>
       
  1327 			<legend class="screen-reader-text"><span>
       
  1328 				<?php
       
  1329 				/* translators: Hidden accessibility text. xfn: https://gmpg.org/xfn/ */
       
  1330 				_e( 'identity' );
       
  1331 				?>
       
  1332 			</span></legend>
  1258 			<label for="me">
  1333 			<label for="me">
  1259 			<input type="checkbox" name="identity" value="me" id="me" <?php xfn_check( 'identity', 'me' ); ?> />
  1334 			<input type="checkbox" name="identity" value="me" id="me" <?php xfn_check( 'identity', 'me' ); ?> />
  1260 			<?php _e( 'another web address of mine' ); ?></label>
  1335 			<?php _e( 'another web address of mine' ); ?></label>
  1261 		</fieldset></td>
  1336 		</fieldset></td>
  1262 	</tr>
  1337 	</tr>
  1263 	<tr>
  1338 	<tr>
  1264 		<th scope="row"><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'friendship' ); ?></th>
  1339 		<th scope="row"><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'friendship' ); ?></th>
  1265 		<td><fieldset><legend class="screen-reader-text"><span><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'friendship' ); ?></span></legend>
  1340 		<td><fieldset>
       
  1341 			<legend class="screen-reader-text"><span>
       
  1342 				<?php
       
  1343 				/* translators: Hidden accessibility text. xfn: https://gmpg.org/xfn/ */
       
  1344 				_e( 'friendship' );
       
  1345 				?>
       
  1346 			</span></legend>
  1266 			<label for="contact">
  1347 			<label for="contact">
  1267 			<input class="valinp" type="radio" name="friendship" value="contact" id="contact" <?php xfn_check( 'friendship', 'contact' ); ?> />&nbsp;<?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'contact' ); ?>
  1348 			<input class="valinp" type="radio" name="friendship" value="contact" id="contact" <?php xfn_check( 'friendship', 'contact' ); ?> />&nbsp;<?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'contact' ); ?>
  1268 			</label>
  1349 			</label>
  1269 			<label for="acquaintance">
  1350 			<label for="acquaintance">
  1270 			<input class="valinp" type="radio" name="friendship" value="acquaintance" id="acquaintance" <?php xfn_check( 'friendship', 'acquaintance' ); ?> />&nbsp;<?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'acquaintance' ); ?>
  1351 			<input class="valinp" type="radio" name="friendship" value="acquaintance" id="acquaintance" <?php xfn_check( 'friendship', 'acquaintance' ); ?> />&nbsp;<?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'acquaintance' ); ?>
  1271 			</label>
  1352 			</label>
  1272 			<label for="friend">
  1353 			<label for="friend">
  1273 			<input class="valinp" type="radio" name="friendship" value="friend" id="friend" <?php xfn_check( 'friendship', 'friend' ); ?> />&nbsp;<?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'friend' ); ?>
  1354 			<input class="valinp" type="radio" name="friendship" value="friend" id="friend" <?php xfn_check( 'friendship', 'friend' ); ?> />&nbsp;<?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'friend' ); ?>
  1274 			</label>
  1355 			</label>
  1275 			<label for="friendship">
  1356 			<label for="friendship">
  1276 			<input name="friendship" type="radio" class="valinp" value="" id="friendship" <?php xfn_check( 'friendship' ); ?> />&nbsp;<?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'none' ); ?>
  1357 			<input name="friendship" type="radio" class="valinp" value="" id="friendship" <?php xfn_check( 'friendship' ); ?> />&nbsp;<?php /* translators: xfn (friendship relation): http://gmpg.org/xfn/ */ _ex( 'none', 'Type of relation' ); ?>
  1277 			</label>
  1358 			</label>
  1278 		</fieldset></td>
  1359 		</fieldset></td>
  1279 	</tr>
  1360 	</tr>
  1280 	<tr>
  1361 	<tr>
  1281 		<th scope="row"> <?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'physical' ); ?> </th>
  1362 		<th scope="row"> <?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'physical' ); ?> </th>
  1282 		<td><fieldset><legend class="screen-reader-text"><span><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'physical' ); ?></span></legend>
  1363 		<td><fieldset>
       
  1364 			<legend class="screen-reader-text"><span>
       
  1365 				<?php
       
  1366 				/* translators: Hidden accessibility text. xfn: https://gmpg.org/xfn/ */
       
  1367 				_e( 'physical' );
       
  1368 				?>
       
  1369 			</span></legend>
  1283 			<label for="met">
  1370 			<label for="met">
  1284 			<input class="valinp" type="checkbox" name="physical" value="met" id="met" <?php xfn_check( 'physical', 'met' ); ?> />&nbsp;<?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'met' ); ?>
  1371 			<input class="valinp" type="checkbox" name="physical" value="met" id="met" <?php xfn_check( 'physical', 'met' ); ?> />&nbsp;<?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'met' ); ?>
  1285 			</label>
  1372 			</label>
  1286 		</fieldset></td>
  1373 		</fieldset></td>
  1287 	</tr>
  1374 	</tr>
  1288 	<tr>
  1375 	<tr>
  1289 		<th scope="row"> <?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'professional' ); ?> </th>
  1376 		<th scope="row"> <?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'professional' ); ?> </th>
  1290 		<td><fieldset><legend class="screen-reader-text"><span><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'professional' ); ?></span></legend>
  1377 		<td><fieldset>
       
  1378 			<legend class="screen-reader-text"><span>
       
  1379 				<?php
       
  1380 				/* translators: Hidden accessibility text. xfn: https://gmpg.org/xfn/ */
       
  1381 				_e( 'professional' );
       
  1382 				?>
       
  1383 			</span></legend>
  1291 			<label for="co-worker">
  1384 			<label for="co-worker">
  1292 			<input class="valinp" type="checkbox" name="professional" value="co-worker" id="co-worker" <?php xfn_check( 'professional', 'co-worker' ); ?> />&nbsp;<?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'co-worker' ); ?>
  1385 			<input class="valinp" type="checkbox" name="professional" value="co-worker" id="co-worker" <?php xfn_check( 'professional', 'co-worker' ); ?> />&nbsp;<?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'co-worker' ); ?>
  1293 			</label>
  1386 			</label>
  1294 			<label for="colleague">
  1387 			<label for="colleague">
  1295 			<input class="valinp" type="checkbox" name="professional" value="colleague" id="colleague" <?php xfn_check( 'professional', 'colleague' ); ?> />&nbsp;<?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'colleague' ); ?>
  1388 			<input class="valinp" type="checkbox" name="professional" value="colleague" id="colleague" <?php xfn_check( 'professional', 'colleague' ); ?> />&nbsp;<?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'colleague' ); ?>
  1296 			</label>
  1389 			</label>
  1297 		</fieldset></td>
  1390 		</fieldset></td>
  1298 	</tr>
  1391 	</tr>
  1299 	<tr>
  1392 	<tr>
  1300 		<th scope="row"><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'geographical' ); ?></th>
  1393 		<th scope="row"><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'geographical' ); ?></th>
  1301 		<td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'geographical' ); ?> </span></legend>
  1394 		<td><fieldset>
       
  1395 			<legend class="screen-reader-text"><span>
       
  1396 				<?php
       
  1397 				/* translators: Hidden accessibility text. xfn: https://gmpg.org/xfn/ */
       
  1398 				_e( 'geographical' );
       
  1399 				?>
       
  1400 			</span></legend>
  1302 			<label for="co-resident">
  1401 			<label for="co-resident">
  1303 			<input class="valinp" type="radio" name="geographical" value="co-resident" id="co-resident" <?php xfn_check( 'geographical', 'co-resident' ); ?> />&nbsp;<?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'co-resident' ); ?>
  1402 			<input class="valinp" type="radio" name="geographical" value="co-resident" id="co-resident" <?php xfn_check( 'geographical', 'co-resident' ); ?> />&nbsp;<?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'co-resident' ); ?>
  1304 			</label>
  1403 			</label>
  1305 			<label for="neighbor">
  1404 			<label for="neighbor">
  1306 			<input class="valinp" type="radio" name="geographical" value="neighbor" id="neighbor" <?php xfn_check( 'geographical', 'neighbor' ); ?> />&nbsp;<?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'neighbor' ); ?>
  1405 			<input class="valinp" type="radio" name="geographical" value="neighbor" id="neighbor" <?php xfn_check( 'geographical', 'neighbor' ); ?> />&nbsp;<?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'neighbor' ); ?>
  1307 			</label>
  1406 			</label>
  1308 			<label for="geographical">
  1407 			<label for="geographical">
  1309 			<input class="valinp" type="radio" name="geographical" value="" id="geographical" <?php xfn_check( 'geographical' ); ?> />&nbsp;<?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'none' ); ?>
  1408 			<input class="valinp" type="radio" name="geographical" value="" id="geographical" <?php xfn_check( 'geographical' ); ?> />&nbsp;<?php /* translators: xfn (geographical relation): http://gmpg.org/xfn/ */ _ex( 'none', 'Type of relation' ); ?>
  1310 			</label>
  1409 			</label>
  1311 		</fieldset></td>
  1410 		</fieldset></td>
  1312 	</tr>
  1411 	</tr>
  1313 	<tr>
  1412 	<tr>
  1314 		<th scope="row"><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'family' ); ?></th>
  1413 		<th scope="row"><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'family' ); ?></th>
  1315 		<td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'family' ); ?> </span></legend>
  1414 		<td><fieldset>
       
  1415 			<legend class="screen-reader-text"><span>
       
  1416 				<?php
       
  1417 				/* translators: Hidden accessibility text. xfn: https://gmpg.org/xfn/ */
       
  1418 				_e( 'family' );
       
  1419 				?>
       
  1420 			</span></legend>
  1316 			<label for="child">
  1421 			<label for="child">
  1317 			<input class="valinp" type="radio" name="family" value="child" id="child" <?php xfn_check( 'family', 'child' ); ?> />&nbsp;<?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'child' ); ?>
  1422 			<input class="valinp" type="radio" name="family" value="child" id="child" <?php xfn_check( 'family', 'child' ); ?> />&nbsp;<?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'child' ); ?>
  1318 			</label>
  1423 			</label>
  1319 			<label for="kin">
  1424 			<label for="kin">
  1320 			<input class="valinp" type="radio" name="family" value="kin" id="kin" <?php xfn_check( 'family', 'kin' ); ?> />&nbsp;<?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'kin' ); ?>
  1425 			<input class="valinp" type="radio" name="family" value="kin" id="kin" <?php xfn_check( 'family', 'kin' ); ?> />&nbsp;<?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'kin' ); ?>
  1327 			</label>
  1432 			</label>
  1328 			<label for="spouse">
  1433 			<label for="spouse">
  1329 			<input class="valinp" type="radio" name="family" value="spouse" id="spouse" <?php xfn_check( 'family', 'spouse' ); ?> />&nbsp;<?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'spouse' ); ?>
  1434 			<input class="valinp" type="radio" name="family" value="spouse" id="spouse" <?php xfn_check( 'family', 'spouse' ); ?> />&nbsp;<?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'spouse' ); ?>
  1330 			</label>
  1435 			</label>
  1331 			<label for="family">
  1436 			<label for="family">
  1332 			<input class="valinp" type="radio" name="family" value="" id="family" <?php xfn_check( 'family' ); ?> />&nbsp;<?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'none' ); ?>
  1437 			<input class="valinp" type="radio" name="family" value="" id="family" <?php xfn_check( 'family' ); ?> />&nbsp;<?php /* translators: xfn (family relation): http://gmpg.org/xfn/ */ _ex( 'none', 'Type of relation' ); ?>
  1333 			</label>
  1438 			</label>
  1334 		</fieldset></td>
  1439 		</fieldset></td>
  1335 	</tr>
  1440 	</tr>
  1336 	<tr>
  1441 	<tr>
  1337 		<th scope="row"><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'romantic' ); ?></th>
  1442 		<th scope="row"><?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'romantic' ); ?></th>
  1338 		<td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'romantic' ); ?> </span></legend>
  1443 		<td><fieldset>
       
  1444 			<legend class="screen-reader-text"><span>
       
  1445 				<?php
       
  1446 				/* translators: Hidden accessibility text. xfn: https://gmpg.org/xfn/ */
       
  1447 				_e( 'romantic' );
       
  1448 				?>
       
  1449 			</span></legend>
  1339 			<label for="muse">
  1450 			<label for="muse">
  1340 			<input class="valinp" type="checkbox" name="romantic" value="muse" id="muse" <?php xfn_check( 'romantic', 'muse' ); ?> />&nbsp;<?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'muse' ); ?>
  1451 			<input class="valinp" type="checkbox" name="romantic" value="muse" id="muse" <?php xfn_check( 'romantic', 'muse' ); ?> />&nbsp;<?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'muse' ); ?>
  1341 			</label>
  1452 			</label>
  1342 			<label for="crush">
  1453 			<label for="crush">
  1343 			<input class="valinp" type="checkbox" name="romantic" value="crush" id="crush" <?php xfn_check( 'romantic', 'crush' ); ?> />&nbsp;<?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'crush' ); ?>
  1454 			<input class="valinp" type="checkbox" name="romantic" value="crush" id="crush" <?php xfn_check( 'romantic', 'crush' ); ?> />&nbsp;<?php /* translators: xfn: https://gmpg.org/xfn/ */ _e( 'crush' ); ?>
  1382 		<th scope="row"><label for="link_rating"><?php _e( 'Rating' ); ?></label></th>
  1493 		<th scope="row"><label for="link_rating"><?php _e( 'Rating' ); ?></label></th>
  1383 		<td><select name="link_rating" id="link_rating" size="1">
  1494 		<td><select name="link_rating" id="link_rating" size="1">
  1384 		<?php
  1495 		<?php
  1385 		for ( $rating = 0; $rating <= 10; $rating++ ) {
  1496 		for ( $rating = 0; $rating <= 10; $rating++ ) {
  1386 			echo '<option value="' . $rating . '"';
  1497 			echo '<option value="' . $rating . '"';
  1387 			if ( isset( $link->link_rating ) && $link->link_rating == $rating ) {
  1498 			if ( isset( $link->link_rating ) && $link->link_rating === $rating ) {
  1388 				echo ' selected="selected"';
  1499 				echo ' selected="selected"';
  1389 			}
  1500 			}
  1390 			echo '>' . $rating . '</option>';
  1501 			echo '>' . $rating . '</option>';
  1391 		}
  1502 		}
  1392 		?>
  1503 		?>
  1457 	}
  1568 	}
  1458 
  1569 
  1459 	$publish_callback_args = array( '__back_compat_meta_box' => true );
  1570 	$publish_callback_args = array( '__back_compat_meta_box' => true );
  1460 
  1571 
  1461 	if ( post_type_supports( $post_type, 'revisions' ) && 'auto-draft' !== $post->post_status ) {
  1572 	if ( post_type_supports( $post_type, 'revisions' ) && 'auto-draft' !== $post->post_status ) {
  1462 		$revisions = wp_get_post_revisions( $post->ID, array( 'fields' => 'ids' ) );
  1573 		$revisions = wp_get_latest_revision_id_and_total_count( $post->ID );
  1463 
  1574 
  1464 		// We should aim to show the revisions meta box only when there are revisions.
  1575 		// We should aim to show the revisions meta box only when there are revisions.
  1465 		if ( count( $revisions ) > 1 ) {
  1576 		if ( ! is_wp_error( $revisions ) && $revisions['count'] > 1 ) {
  1466 			$publish_callback_args = array(
  1577 			$publish_callback_args = array(
  1467 				'revisions_count'        => count( $revisions ),
  1578 				'revisions_count'        => $revisions['count'],
  1468 				'revision_id'            => reset( $revisions ),
  1579 				'revision_id'            => $revisions['latest_id'],
  1469 				'__back_compat_meta_box' => true,
  1580 				'__back_compat_meta_box' => true,
  1470 			);
  1581 			);
  1471 
  1582 
  1472 			add_meta_box( 'revisionsdiv', __( 'Revisions' ), 'post_revisions_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) );
  1583 			add_meta_box( 'revisionsdiv', __( 'Revisions' ), 'post_revisions_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) );
  1473 		}
  1584 		}
  1558 	 *
  1669 	 *
  1559 	 * @param WP_Post $post Post object.
  1670 	 * @param WP_Post $post Post object.
  1560 	 */
  1671 	 */
  1561 	do_action_deprecated( 'dbx_post_advanced', array( $post ), '3.7.0', 'add_meta_boxes' );
  1672 	do_action_deprecated( 'dbx_post_advanced', array( $post ), '3.7.0', 'add_meta_boxes' );
  1562 
  1673 
  1563 	// Allow the Discussion meta box to show up if the post type supports comments,
  1674 	/*
  1564 	// or if comments or pings are open.
  1675 	 * Allow the Discussion meta box to show up if the post type supports comments,
       
  1676 	 * or if comments or pings are open.
       
  1677 	 */
  1565 	if ( comments_open( $post ) || pings_open( $post ) || post_type_supports( $post_type, 'comments' ) ) {
  1678 	if ( comments_open( $post ) || pings_open( $post ) || post_type_supports( $post_type, 'comments' ) ) {
  1566 		add_meta_box( 'commentstatusdiv', __( 'Discussion' ), 'post_comment_status_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) );
  1679 		add_meta_box( 'commentstatusdiv', __( 'Discussion' ), 'post_comment_status_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) );
  1567 	}
  1680 	}
  1568 
  1681 
  1569 	$stati = get_post_stati( array( 'public' => true ) );
  1682 	$statuses = get_post_stati( array( 'public' => true ) );
  1570 	if ( empty( $stati ) ) {
  1683 
  1571 		$stati = array( 'publish' );
  1684 	if ( empty( $statuses ) ) {
  1572 	}
  1685 		$statuses = array( 'publish' );
  1573 	$stati[] = 'private';
  1686 	}
  1574 
  1687 
  1575 	if ( in_array( get_post_status( $post ), $stati, true ) ) {
  1688 	$statuses[] = 'private';
  1576 		// If the post type support comments, or the post has comments,
  1689 
  1577 		// allow the Comments meta box.
  1690 	if ( in_array( get_post_status( $post ), $statuses, true ) ) {
       
  1691 		/*
       
  1692 		 * If the post type support comments, or the post has comments,
       
  1693 		 * allow the Comments meta box.
       
  1694 		 */
  1578 		if ( comments_open( $post ) || pings_open( $post ) || $post->comment_count > 0 || post_type_supports( $post_type, 'comments' ) ) {
  1695 		if ( comments_open( $post ) || pings_open( $post ) || $post->comment_count > 0 || post_type_supports( $post_type, 'comments' ) ) {
  1579 			add_meta_box( 'commentsdiv', __( 'Comments' ), 'post_comment_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) );
  1696 			add_meta_box( 'commentsdiv', __( 'Comments' ), 'post_comment_meta_box', null, 'normal', 'core', array( '__back_compat_meta_box' => true ) );
  1580 		}
  1697 		}
  1581 	}
  1698 	}
  1582 
  1699