wp/wp-admin/includes/meta-boxes.php
changeset 18 be944660c56a
parent 16 a86126ab1dd4
child 19 3d72ae0968f4
equal deleted inserted replaced
17:34716fd837a4 18:be944660c56a
   210 				</div>
   210 				</div>
   211 			<?php } ?>
   211 			<?php } ?>
   212 		</div>
   212 		</div>
   213 
   213 
   214 		<?php
   214 		<?php
   215 		/* translators: Publish box date string. 1: Date, 2: Time. See https://www.php.net/date */
   215 		/* translators: Publish box date string. 1: Date, 2: Time. See https://www.php.net/manual/datetime.format.php */
   216 		$date_string = __( '%1$s at %2$s' );
   216 		$date_string = __( '%1$s at %2$s' );
   217 		/* translators: Publish box date format, see https://www.php.net/date */
   217 		/* translators: Publish box date format, see https://www.php.net/manual/datetime.format.php */
   218 		$date_format = _x( 'M j, Y', 'publish box date format' );
   218 		$date_format = _x( 'M j, Y', 'publish box date format' );
   219 		/* translators: Publish box time format, see https://www.php.net/date */
   219 		/* translators: Publish box time format, see https://www.php.net/manual/datetime.format.php */
   220 		$time_format = _x( 'H:i', 'publish box time format' );
   220 		$time_format = _x( 'H:i', 'publish box time format' );
   221 
   221 
   222 		if ( 0 !== $post_id ) {
   222 		if ( 0 !== $post_id ) {
   223 			if ( 'future' === $post->post_status ) { // Scheduled for publishing at a future date.
   223 			if ( 'future' === $post->post_status ) { // Scheduled for publishing at a future date.
   224 				/* translators: Post date information. %s: Date on which the post is currently scheduled to be published. */
   224 				/* translators: Post date information. %s: Date on which the post is currently scheduled to be published. */
   383 /**
   383 /**
   384  * Display attachment submit form fields.
   384  * Display attachment submit form fields.
   385  *
   385  *
   386  * @since 3.5.0
   386  * @since 3.5.0
   387  *
   387  *
   388  * @param object $post
   388  * @param WP_Post $post
   389  */
   389  */
   390 function attachment_submit_meta_box( $post ) {
   390 function attachment_submit_meta_box( $post ) {
   391 	?>
   391 	?>
   392 <div class="submitbox" id="submitpost">
   392 <div class="submitbox" id="submitpost">
   393 
   393 
   402 <div id="misc-publishing-actions">
   402 <div id="misc-publishing-actions">
   403 	<div class="misc-pub-section curtime misc-pub-curtime">
   403 	<div class="misc-pub-section curtime misc-pub-curtime">
   404 		<span id="timestamp">
   404 		<span id="timestamp">
   405 			<?php
   405 			<?php
   406 			$uploaded_on = sprintf(
   406 			$uploaded_on = sprintf(
   407 				/* translators: Publish box date string. 1: Date, 2: Time. See https://www.php.net/date */
   407 				/* translators: Publish box date string. 1: Date, 2: Time. See https://www.php.net/manual/datetime.format.php */
   408 				__( '%1$s at %2$s' ),
   408 				__( '%1$s at %2$s' ),
   409 				/* translators: Publish box date format, see https://www.php.net/date */
   409 				/* translators: Publish box date format, see https://www.php.net/manual/datetime.format.php */
   410 				date_i18n( _x( 'M j, Y', 'publish box date format' ), strtotime( $post->post_date ) ),
   410 				date_i18n( _x( 'M j, Y', 'publish box date format' ), strtotime( $post->post_date ) ),
   411 				/* translators: Publish box time format, see https://www.php.net/date */
   411 				/* translators: Publish box time format, see https://www.php.net/manual/datetime.format.php */
   412 				date_i18n( _x( 'H:i', 'publish box time format' ), strtotime( $post->post_date ) )
   412 				date_i18n( _x( 'H:i', 'publish box time format' ), strtotime( $post->post_date ) )
   413 			);
   413 			);
   414 			/* translators: Attachment information. %s: Date the attachment was uploaded. */
   414 			/* translators: Attachment information. %s: Date the attachment was uploaded. */
   415 			printf( __( 'Uploaded on: %s' ), '<b>' . $uploaded_on . '</b>' );
   415 			printf( __( 'Uploaded on: %s' ), '<b>' . $uploaded_on . '</b>' );
   416 			?>
   416 			?>
   636 						printf( __( '+ %s' ), $taxonomy->labels->add_new_item );
   636 						printf( __( '+ %s' ), $taxonomy->labels->add_new_item );
   637 					?>
   637 					?>
   638 				</a>
   638 				</a>
   639 				<p id="<?php echo $tax_name; ?>-add" class="category-add wp-hidden-child">
   639 				<p id="<?php echo $tax_name; ?>-add" class="category-add wp-hidden-child">
   640 					<label class="screen-reader-text" for="new<?php echo $tax_name; ?>"><?php echo $taxonomy->labels->add_new_item; ?></label>
   640 					<label class="screen-reader-text" for="new<?php echo $tax_name; ?>"><?php echo $taxonomy->labels->add_new_item; ?></label>
   641 					<input type="text" name="new<?php echo $tax_name; ?>" id="new<?php echo $tax_name; ?>" class="form-required form-input-tip" value="<?php echo esc_attr( $taxonomy->labels->new_item_name ); ?>" aria-required="true"/>
   641 					<input type="text" name="new<?php echo $tax_name; ?>" id="new<?php echo $tax_name; ?>" class="form-required form-input-tip" value="<?php echo esc_attr( $taxonomy->labels->new_item_name ); ?>" aria-required="true" />
   642 					<label class="screen-reader-text" for="new<?php echo $tax_name; ?>_parent">
   642 					<label class="screen-reader-text" for="new<?php echo $tax_name; ?>_parent">
   643 						<?php echo $taxonomy->labels->parent_item_colon; ?>
   643 						<?php echo $taxonomy->labels->parent_item_colon; ?>
   644 					</label>
   644 					</label>
   645 					<?php
   645 					<?php
   646 					$parent_dropdown_args = array(
   646 					$parent_dropdown_args = array(
   693 /**
   693 /**
   694  * Display post excerpt form fields.
   694  * Display post excerpt form fields.
   695  *
   695  *
   696  * @since 2.6.0
   696  * @since 2.6.0
   697  *
   697  *
   698  * @param object $post
   698  * @param WP_Post $post
   699  */
   699  */
   700 function post_excerpt_meta_box( $post ) {
   700 function post_excerpt_meta_box( $post ) {
   701 	?>
   701 	?>
   702 <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>
   702 <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>
   703 <p>
   703 <p>
   715 /**
   715 /**
   716  * Display trackback links form fields.
   716  * Display trackback links form fields.
   717  *
   717  *
   718  * @since 2.6.0
   718  * @since 2.6.0
   719  *
   719  *
   720  * @param object $post
   720  * @param WP_Post $post
   721  */
   721  */
   722 function post_trackback_meta_box( $post ) {
   722 function post_trackback_meta_box( $post ) {
   723 	$form_trackback = '<input type="text" name="trackback_url" id="trackback_url" class="code" value="' .
   723 	$form_trackback = '<input type="text" name="trackback_url" id="trackback_url" class="code" value="' .
   724 		esc_attr( str_replace( "\n", ' ', $post->to_ping ) ) . '" aria-describedby="trackback-url-desc" />';
   724 		esc_attr( str_replace( "\n", ' ', $post->to_ping ) ) . '" aria-describedby="trackback-url-desc" />';
   725 
   725 
   756 /**
   756 /**
   757  * Display custom fields form fields.
   757  * Display custom fields form fields.
   758  *
   758  *
   759  * @since 2.6.0
   759  * @since 2.6.0
   760  *
   760  *
   761  * @param object $post
   761  * @param WP_Post $post
   762  */
   762  */
   763 function post_custom_meta_box( $post ) {
   763 function post_custom_meta_box( $post ) {
   764 	?>
   764 	?>
   765 <div id="postcustomstuff">
   765 <div id="postcustomstuff">
   766 <div id="ajax-response"></div>
   766 <div id="ajax-response"></div>
   790 /**
   790 /**
   791  * Display comments status form fields.
   791  * Display comments status form fields.
   792  *
   792  *
   793  * @since 2.6.0
   793  * @since 2.6.0
   794  *
   794  *
   795  * @param object $post
   795  * @param WP_Post $post
   796  */
   796  */
   797 function post_comment_status_meta_box( $post ) {
   797 function post_comment_status_meta_box( $post ) {
   798 	?>
   798 	?>
   799 <input name="advanced_view" type="hidden" value="1" />
   799 <input name="advanced_view" type="hidden" value="1" />
   800 <p class="meta-options">
   800 <p class="meta-options">
   838 /**
   838 /**
   839  * Display comments for post.
   839  * Display comments for post.
   840  *
   840  *
   841  * @since 2.8.0
   841  * @since 2.8.0
   842  *
   842  *
   843  * @param object $post
   843  * @param WP_Post $post
   844  */
   844  */
   845 function post_comment_meta_box( $post ) {
   845 function post_comment_meta_box( $post ) {
   846 	wp_nonce_field( 'get-comments', 'add_comment_nonce', false );
   846 	wp_nonce_field( 'get-comments', 'add_comment_nonce', false );
   847 	?>
   847 	?>
   848 	<p class="hide-if-no-js" id="add-new-comment"><button type="button" class="button" onclick="window.commentReply && commentReply.addcomment(<?php echo $post->ID; ?>);"><?php _e( 'Add Comment' ); ?></button></p>
   848 	<p class="hide-if-no-js" id="add-new-comment"><button type="button" class="button" onclick="window.commentReply && commentReply.addcomment(<?php echo $post->ID; ?>);"><?php _e( 'Add Comment' ); ?></button></p>
   879 /**
   879 /**
   880  * Display slug form fields.
   880  * Display slug form fields.
   881  *
   881  *
   882  * @since 2.6.0
   882  * @since 2.6.0
   883  *
   883  *
   884  * @param object $post
   884  * @param WP_Post $post
   885  */
   885  */
   886 function post_slug_meta_box( $post ) {
   886 function post_slug_meta_box( $post ) {
   887 	/** This filter is documented in wp-admin/edit-tag-form.php */
   887 	/** This filter is documented in wp-admin/edit-tag-form.php */
   888 	$editable_slug = apply_filters( 'editable_slug', $post->post_name, $post );
   888 	$editable_slug = apply_filters( 'editable_slug', $post->post_name, $post );
   889 	?>
   889 	?>
   896  *
   896  *
   897  * @since 2.6.0
   897  * @since 2.6.0
   898  *
   898  *
   899  * @global int $user_ID
   899  * @global int $user_ID
   900  *
   900  *
   901  * @param object $post
   901  * @param WP_Post $post
   902  */
   902  */
   903 function post_author_meta_box( $post ) {
   903 function post_author_meta_box( $post ) {
   904 	global $user_ID;
   904 	global $user_ID;
   905 	?>
   905 	?>
   906 <label class="screen-reader-text" for="post_author_override"><?php _e( 'Author' ); ?></label>
   906 <label class="screen-reader-text" for="post_author_override"><?php _e( 'Author' ); ?></label>
   919 /**
   919 /**
   920  * Display list of revisions.
   920  * Display list of revisions.
   921  *
   921  *
   922  * @since 2.6.0
   922  * @since 2.6.0
   923  *
   923  *
   924  * @param object $post
   924  * @param WP_Post $post
   925  */
   925  */
   926 function post_revisions_meta_box( $post ) {
   926 function post_revisions_meta_box( $post ) {
   927 	wp_list_post_revisions( $post );
   927 	wp_list_post_revisions( $post );
   928 }
   928 }
   929 
   929 
   934 /**
   934 /**
   935  * Display page attributes form fields.
   935  * Display page attributes form fields.
   936  *
   936  *
   937  * @since 2.7.0
   937  * @since 2.7.0
   938  *
   938  *
   939  * @param object $post
   939  * @param WP_Post $post
   940  */
   940  */
   941 function page_attributes_meta_box( $post ) {
   941 function page_attributes_meta_box( $post ) {
   942 	if ( is_post_type_hierarchical( $post->post_type ) ) :
   942 	if ( is_post_type_hierarchical( $post->post_type ) ) :
   943 		$dropdown_args = array(
   943 		$dropdown_args = array(
   944 			'post_type'        => $post->post_type,
   944 			'post_type'        => $post->post_type,