wp/wp-admin/includes/meta-boxes.php
changeset 5 5e2f62d02dcd
parent 0 d970ebf37754
child 7 cf61fcea0001
equal deleted inserted replaced
4:346c88efed21 5:5e2f62d02dcd
    40 if ( 'publish' == $post->post_status ) {
    40 if ( 'publish' == $post->post_status ) {
    41 	$preview_link = esc_url( get_permalink( $post->ID ) );
    41 	$preview_link = esc_url( get_permalink( $post->ID ) );
    42 	$preview_button = __( 'Preview Changes' );
    42 	$preview_button = __( 'Preview Changes' );
    43 } else {
    43 } else {
    44 	$preview_link = set_url_scheme( get_permalink( $post->ID ) );
    44 	$preview_link = set_url_scheme( get_permalink( $post->ID ) );
    45 	$preview_link = esc_url( apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ) ) );
    45 
       
    46 	/**
       
    47 	 * Filter the URI of a post preview in the post submit box.
       
    48 	 *
       
    49 	 * @since 2.0.5
       
    50 	 * @since 4.0.0 $post parameter was added.
       
    51 	 *
       
    52 	 * @param string  $preview_link URI the user will be directed to for a post preview.
       
    53 	 * @param WP_Post $post         Post object.
       
    54 	 */
       
    55 	$preview_link = esc_url( apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ), $post ) );
    46 	$preview_button = __( 'Preview' );
    56 	$preview_button = __( 'Preview' );
    47 }
    57 }
    48 ?>
    58 ?>
    49 <a class="preview button" href="<?php echo $preview_link; ?>" target="wp-preview" id="post-preview"><?php echo $preview_button; ?></a>
    59 <a class="preview button" href="<?php echo $preview_link; ?>" target="wp-preview-<?php echo (int) $post->ID; ?>" id="post-preview"><?php echo $preview_button; ?></a>
    50 <input type="hidden" name="wp-preview" id="wp-preview" value="" />
    60 <input type="hidden" name="wp-preview" id="wp-preview" value="" />
    51 </div>
    61 </div>
    52 <?php endif; // public post type ?>
    62 <?php endif; // public post type ?>
    53 <div class="clear"></div>
    63 <div class="clear"></div>
    54 </div><!-- #minor-publishing-actions -->
    64 </div><!-- #minor-publishing-actions -->
    77 		break;
    87 		break;
    78 }
    88 }
    79 ?>
    89 ?>
    80 </span>
    90 </span>
    81 <?php if ( 'publish' == $post->post_status || 'private' == $post->post_status || $can_publish ) { ?>
    91 <?php if ( 'publish' == $post->post_status || 'private' == $post->post_status || $can_publish ) { ?>
    82 <a href="#post_status" <?php if ( 'private' == $post->post_status ) { ?>style="display:none;" <?php } ?>class="edit-post-status hide-if-no-js"><?php _e('Edit') ?></a>
    92 <a href="#post_status" <?php if ( 'private' == $post->post_status ) { ?>style="display:none;" <?php } ?>class="edit-post-status hide-if-no-js"><span aria-hidden="true"><?php _e( 'Edit' ); ?></span> <span class="screen-reader-text"><?php _e( 'Edit status' ); ?></span></a>
    83 
    93 
    84 <div id="post-status-select" class="hide-if-js">
    94 <div id="post-status-select" class="hide-if-js">
    85 <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); ?>" />
    95 <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); ?>" />
    86 <select name='post_status' id='post_status'>
    96 <select name='post_status' id='post_status'>
    87 <?php if ( 'publish' == $post->post_status ) : ?>
    97 <?php if ( 'publish' == $post->post_status ) : ?>
    97 <?php else : ?>
   107 <?php else : ?>
    98 <option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e('Draft') ?></option>
   108 <option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e('Draft') ?></option>
    99 <?php endif; ?>
   109 <?php endif; ?>
   100 </select>
   110 </select>
   101  <a href="#post_status" class="save-post-status hide-if-no-js button"><?php _e('OK'); ?></a>
   111  <a href="#post_status" class="save-post-status hide-if-no-js button"><?php _e('OK'); ?></a>
   102  <a href="#post_status" class="cancel-post-status hide-if-no-js"><?php _e('Cancel'); ?></a>
   112  <a href="#post_status" class="cancel-post-status hide-if-no-js button-cancel"><?php _e('Cancel'); ?></a>
   103 </div>
   113 </div>
   104 
   114 
   105 <?php } ?>
   115 <?php } ?>
   106 </div><!-- .misc-pub-section -->
   116 </div><!-- .misc-pub-section -->
   107 
   117 
   123 	$visibility_trans = __('Public');
   133 	$visibility_trans = __('Public');
   124 }
   134 }
   125 
   135 
   126 echo esc_html( $visibility_trans ); ?></span>
   136 echo esc_html( $visibility_trans ); ?></span>
   127 <?php if ( $can_publish ) { ?>
   137 <?php if ( $can_publish ) { ?>
   128 <a href="#visibility" class="edit-visibility hide-if-no-js"><?php _e('Edit'); ?></a>
   138 <a href="#visibility" class="edit-visibility hide-if-no-js"><span aria-hidden="true"><?php _e( 'Edit' ); ?></span> <span class="screen-reader-text"><?php _e( 'Edit visibility' ); ?></span></a>
   129 
   139 
   130 <div id="post-visibility-select" class="hide-if-js">
   140 <div id="post-visibility-select" class="hide-if-js">
   131 <input type="hidden" name="hidden_post_password" id="hidden-post-password" value="<?php echo esc_attr($post->post_password); ?>" />
   141 <input type="hidden" name="hidden_post_password" id="hidden-post-password" value="<?php echo esc_attr($post->post_password); ?>" />
   132 <?php if ($post_type == 'post'): ?>
   142 <?php if ($post_type == 'post'): ?>
   133 <input type="checkbox" style="display:none" name="hidden_post_sticky" id="hidden-post-sticky" value="sticky" <?php checked(is_sticky($post->ID)); ?> />
   143 <input type="checkbox" style="display:none" name="hidden_post_sticky" id="hidden-post-sticky" value="sticky" <?php checked(is_sticky($post->ID)); ?> />
   141 <span id="password-span"><label for="post_password"><?php _e('Password:'); ?></label> <input type="text" name="post_password" id="post_password" value="<?php echo esc_attr($post->post_password); ?>"  maxlength="20" /><br /></span>
   151 <span id="password-span"><label for="post_password"><?php _e('Password:'); ?></label> <input type="text" name="post_password" id="post_password" value="<?php echo esc_attr($post->post_password); ?>"  maxlength="20" /><br /></span>
   142 <input type="radio" name="visibility" id="visibility-radio-private" value="private" <?php checked( $visibility, 'private' ); ?> /> <label for="visibility-radio-private" class="selectit"><?php _e('Private'); ?></label><br />
   152 <input type="radio" name="visibility" id="visibility-radio-private" value="private" <?php checked( $visibility, 'private' ); ?> /> <label for="visibility-radio-private" class="selectit"><?php _e('Private'); ?></label><br />
   143 
   153 
   144 <p>
   154 <p>
   145  <a href="#visibility" class="save-post-visibility hide-if-no-js button"><?php _e('OK'); ?></a>
   155  <a href="#visibility" class="save-post-visibility hide-if-no-js button"><?php _e('OK'); ?></a>
   146  <a href="#visibility" class="cancel-post-visibility hide-if-no-js"><?php _e('Cancel'); ?></a>
   156  <a href="#visibility" class="cancel-post-visibility hide-if-no-js button-cancel"><?php _e('Cancel'); ?></a>
   147 </p>
   157 </p>
   148 </div>
   158 </div>
   149 <?php } ?>
   159 <?php } ?>
   150 
   160 
   151 </div><!-- .misc-pub-section -->
   161 </div><!-- .misc-pub-section -->
   152 
   162 
   153 <?php
   163 <?php
   154 // translators: Publish box date format, see http://php.net/date
   164 /* translators: Publish box date format, see http://php.net/date */
   155 $datef = __( 'M j, Y @ G:i' );
   165 $datef = __( 'M j, Y @ H:i' );
   156 if ( 0 != $post->ID ) {
   166 if ( 0 != $post->ID ) {
   157 	if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date
   167 	if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date
   158 		$stamp = __('Scheduled for: <b>%1$s</b>');
   168 		$stamp = __('Scheduled for: <b>%1$s</b>');
   159 	} else if ( 'publish' == $post->post_status || 'private' == $post->post_status ) { // already published
   169 	} elseif ( 'publish' == $post->post_status || 'private' == $post->post_status ) { // already published
   160 		$stamp = __('Published on: <b>%1$s</b>');
   170 		$stamp = __('Published on: <b>%1$s</b>');
   161 	} else if ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified
   171 	} elseif ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified
   162 		$stamp = __('Publish <b>immediately</b>');
   172 		$stamp = __('Publish <b>immediately</b>');
   163 	} else if ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) { // draft, 1 or more saves, future date specified
   173 	} elseif ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) { // draft, 1 or more saves, future date specified
   164 		$stamp = __('Schedule for: <b>%1$s</b>');
   174 		$stamp = __('Schedule for: <b>%1$s</b>');
   165 	} else { // draft, 1 or more saves, date specified
   175 	} else { // draft, 1 or more saves, date specified
   166 		$stamp = __('Publish on: <b>%1$s</b>');
   176 		$stamp = __('Publish on: <b>%1$s</b>');
   167 	}
   177 	}
   168 	$date = date_i18n( $datef, strtotime( $post->post_date ) );
   178 	$date = date_i18n( $datef, strtotime( $post->post_date ) );
   183 		echo '</span>';
   193 		echo '</span>';
   184 	} else {
   194 	} else {
   185 		printf( __( 'Revisions: %s' ), '<b>' . number_format_i18n( $args['args']['revisions_count'] ) . '</b>' );
   195 		printf( __( 'Revisions: %s' ), '<b>' . number_format_i18n( $args['args']['revisions_count'] ) . '</b>' );
   186 	}
   196 	}
   187 ?>
   197 ?>
   188 	<a class="hide-if-no-js" href="<?php echo esc_url( get_edit_post_link( $args['args']['revision_id'] ) ); ?>"><?php _ex( 'Browse', 'revisions' ); ?></a>
   198 	<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>
   189 </div>
   199 </div>
   190 <?php endif;
   200 <?php endif;
   191 
   201 
   192 if ( $can_publish ) : // Contributors don't get to choose the date of publish ?>
   202 if ( $can_publish ) : // Contributors don't get to choose the date of publish ?>
   193 <div class="misc-pub-section curtime misc-pub-curtime">
   203 <div class="misc-pub-section curtime misc-pub-curtime">
   194 	<span id="timestamp">
   204 	<span id="timestamp">
   195 	<?php printf($stamp, $date); ?></span>
   205 	<?php printf($stamp, $date); ?></span>
   196 	<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js"><?php _e('Edit') ?></a>
   206 	<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js"><span aria-hidden="true"><?php _e( 'Edit' ); ?></span> <span class="screen-reader-text"><?php _e( 'Edit date and time' ); ?></span></a>
   197 	<div id="timestampdiv" class="hide-if-js"><?php touch_time(($action == 'edit'), 1); ?></div>
   207 	<div id="timestampdiv" class="hide-if-js"><?php touch_time(($action == 'edit'), 1); ?></div>
   198 </div><?php // /misc-pub-section ?>
   208 </div><?php // /misc-pub-section ?>
   199 <?php endif; ?>
   209 <?php endif; ?>
   200 
   210 
   201 <?php do_action('post_submitbox_misc_actions'); ?>
   211 <?php
       
   212 /**
       
   213  * Fires after the post time/date setting in the Publish meta box.
       
   214  *
       
   215  * @since 2.9.0
       
   216  */
       
   217 do_action( 'post_submitbox_misc_actions' );
       
   218 ?>
   202 </div>
   219 </div>
   203 <div class="clear"></div>
   220 <div class="clear"></div>
   204 </div>
   221 </div>
   205 
   222 
   206 <div id="major-publishing-actions">
   223 <div id="major-publishing-actions">
   207 <?php do_action('post_submitbox_start'); ?>
   224 <?php
       
   225 /**
       
   226  * Fires at the beginning of the publishing actions section of the Publish meta box.
       
   227  *
       
   228  * @since 2.7.0
       
   229  */
       
   230 do_action( 'post_submitbox_start' );
       
   231 ?>
   208 <div id="delete-action">
   232 <div id="delete-action">
   209 <?php
   233 <?php
   210 if ( current_user_can( "delete_post", $post->ID ) ) {
   234 if ( current_user_can( "delete_post", $post->ID ) ) {
   211 	if ( !EMPTY_TRASH_DAYS )
   235 	if ( !EMPTY_TRASH_DAYS )
   212 		$delete_text = __('Delete Permanently');
   236 		$delete_text = __('Delete Permanently');
   222 <?php
   246 <?php
   223 if ( !in_array( $post->post_status, array('publish', 'future', 'private') ) || 0 == $post->ID ) {
   247 if ( !in_array( $post->post_status, array('publish', 'future', 'private') ) || 0 == $post->ID ) {
   224 	if ( $can_publish ) :
   248 	if ( $can_publish ) :
   225 		if ( !empty($post->post_date_gmt) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : ?>
   249 		if ( !empty($post->post_date_gmt) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : ?>
   226 		<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Schedule') ?>" />
   250 		<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Schedule') ?>" />
   227 		<?php submit_button( __( 'Schedule' ), 'primary button-large', 'publish', false, array( 'accesskey' => 'p' ) ); ?>
   251 		<?php submit_button( __( 'Schedule' ), 'primary button-large', 'publish', false ); ?>
   228 <?php	else : ?>
   252 <?php	else : ?>
   229 		<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Publish') ?>" />
   253 		<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Publish') ?>" />
   230 		<?php submit_button( __( 'Publish' ), 'primary button-large', 'publish', false, array( 'accesskey' => 'p' ) ); ?>
   254 		<?php submit_button( __( 'Publish' ), 'primary button-large', 'publish', false ); ?>
   231 <?php	endif;
   255 <?php	endif;
   232 	else : ?>
   256 	else : ?>
   233 		<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Submit for Review') ?>" />
   257 		<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Submit for Review') ?>" />
   234 		<?php submit_button( __( 'Submit for Review' ), 'primary button-large', 'publish', false, array( 'accesskey' => 'p' ) ); ?>
   258 		<?php submit_button( __( 'Submit for Review' ), 'primary button-large', 'publish', false ); ?>
   235 <?php
   259 <?php
   236 	endif;
   260 	endif;
   237 } else { ?>
   261 } else { ?>
   238 		<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Update') ?>" />
   262 		<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Update') ?>" />
   239 		<input name="save" type="submit" class="button button-primary button-large" id="publish" accesskey="p" value="<?php esc_attr_e('Update') ?>" />
   263 		<input name="save" type="submit" class="button button-primary button-large" id="publish" value="<?php esc_attr_e( 'Update' ) ?>" />
   240 <?php
   264 <?php
   241 } ?>
   265 } ?>
   242 </div>
   266 </div>
   243 <div class="clear"></div>
   267 <div class="clear"></div>
   244 </div>
   268 </div>
   253  * @since 3.5.0
   277  * @since 3.5.0
   254  *
   278  *
   255  * @param object $post
   279  * @param object $post
   256  */
   280  */
   257 function attachment_submit_meta_box( $post ) {
   281 function attachment_submit_meta_box( $post ) {
   258 	global $action;
       
   259 
       
   260 	$post_type = $post->post_type;
       
   261 	$post_type_object = get_post_type_object($post_type);
       
   262 	$can_publish = current_user_can($post_type_object->cap->publish_posts);
       
   263 ?>
   282 ?>
   264 <div class="submitbox" id="submitpost">
   283 <div class="submitbox" id="submitpost">
   265 
   284 
   266 <div id="minor-publishing">
   285 <div id="minor-publishing">
   267 
   286 
   271 </div>
   290 </div>
   272 
   291 
   273 
   292 
   274 <div id="misc-publishing-actions">
   293 <div id="misc-publishing-actions">
   275 	<?php
   294 	<?php
   276 	// translators: Publish box date format, see http://php.net/date
   295 	/* translators: Publish box date format, see http://php.net/date */
   277 	$datef = __( 'M j, Y @ G:i' );
   296 	$datef = __( 'M j, Y @ H:i' );
   278 	$stamp = __('Uploaded on: <b>%1$s</b>');
   297 	$stamp = __('Uploaded on: <b>%1$s</b>');
   279 	$date = date_i18n( $datef, strtotime( $post->post_date ) );
   298 	$date = date_i18n( $datef, strtotime( $post->post_date ) );
   280 	?>
   299 	?>
   281 	<div class="misc-pub-section curtime misc-pub-curtime">
   300 	<div class="misc-pub-section curtime misc-pub-curtime">
   282 		<span id="timestamp"><?php printf($stamp, $date); ?></span>
   301 		<span id="timestamp"><?php printf($stamp, $date); ?></span>
   283 	</div><!-- .misc-pub-section -->
   302 	</div><!-- .misc-pub-section -->
   284 
   303 
   285 	<?php do_action('attachment_submitbox_misc_actions'); ?>
   304 	<?php
       
   305 	/**
       
   306 	 * Fires after the 'Uploaded on' section of the Save meta box
       
   307 	 * in the attachment editing screen.
       
   308 	 *
       
   309 	 * @since 3.5.0
       
   310 	 */
       
   311 	do_action( 'attachment_submitbox_misc_actions' );
       
   312 	?>
   286 </div><!-- #misc-publishing-actions -->
   313 </div><!-- #misc-publishing-actions -->
   287 <div class="clear"></div>
   314 <div class="clear"></div>
   288 </div><!-- #minor-publishing -->
   315 </div><!-- #minor-publishing -->
   289 
   316 
   290 <div id="major-publishing-actions">
   317 <div id="major-publishing-actions">
   301 	</div>
   328 	</div>
   302 
   329 
   303 	<div id="publishing-action">
   330 	<div id="publishing-action">
   304 		<span class="spinner"></span>
   331 		<span class="spinner"></span>
   305 		<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Update') ?>" />
   332 		<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Update') ?>" />
   306 		<input name="save" type="submit" class="button-primary button-large" id="publish" accesskey="p" value="<?php esc_attr_e('Update') ?>" />
   333 		<input name="save" type="submit" class="button-primary button-large" id="publish" value="<?php esc_attr_e( 'Update' ) ?>" />
   307 	</div>
   334 	</div>
   308 	<div class="clear"></div>
   335 	<div class="clear"></div>
   309 </div><!-- #major-publishing-actions -->
   336 </div><!-- #major-publishing-actions -->
   310 
   337 
   311 </div>
   338 </div>
   316 /**
   343 /**
   317  * Display post format form elements.
   344  * Display post format form elements.
   318  *
   345  *
   319  * @since 3.1.0
   346  * @since 3.1.0
   320  *
   347  *
   321  * @param object $post
   348  * @param WP_Post $post Post object.
       
   349  * @param array   $box {
       
   350  *     Post formats meta box arguments.
       
   351  *
       
   352  *     @type string   $id       Meta box ID.
       
   353  *     @type string   $title    Meta box title.
       
   354  *     @type callback $callback Meta box display callback.
       
   355  *     @type array    $args     Extra meta box arguments.
       
   356  * }
   322  */
   357  */
   323 function post_format_meta_box( $post, $box ) {
   358 function post_format_meta_box( $post, $box ) {
   324 	if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post->post_type, 'post-formats' ) ) :
   359 	if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post->post_type, 'post-formats' ) ) :
   325 	$post_formats = get_theme_support( 'post-formats' );
   360 	$post_formats = get_theme_support( 'post-formats' );
   326 
   361 
   344 /**
   379 /**
   345  * Display post tags form fields.
   380  * Display post tags form fields.
   346  *
   381  *
   347  * @since 2.6.0
   382  * @since 2.6.0
   348  *
   383  *
   349  * @param object $post
   384  * @todo Create taxonomy-agnostic wrapper for this.
   350  */
   385  *
   351 function post_tags_meta_box($post, $box) {
   386  * @param WP_Post $post Post object.
   352 	$defaults = array('taxonomy' => 'post_tag');
   387  * @param array   $box {
   353 	if ( !isset($box['args']) || !is_array($box['args']) )
   388  *     Tags meta box arguments.
       
   389  *
       
   390  *     @type string   $id       Meta box ID.
       
   391  *     @type string   $title    Meta box title.
       
   392  *     @type callback $callback Meta box display callback.
       
   393  *     @type array    $args {
       
   394  *         Extra meta box arguments.
       
   395  *
       
   396  *         @type string $taxonomy Taxonomy. Default 'post_tag'.
       
   397  *     }
       
   398  * }
       
   399  */
       
   400 function post_tags_meta_box( $post, $box ) {
       
   401 	$defaults = array( 'taxonomy' => 'post_tag' );
       
   402 	if ( ! isset( $box['args'] ) || ! is_array( $box['args'] ) ) {
   354 		$args = array();
   403 		$args = array();
   355 	else
   404 	} else {
   356 		$args = $box['args'];
   405 		$args = $box['args'];
   357 	extract( wp_parse_args($args, $defaults), EXTR_SKIP );
   406 	}
   358 	$tax_name = esc_attr($taxonomy);
   407 	$r = wp_parse_args( $args, $defaults );
   359 	$taxonomy = get_taxonomy($taxonomy);
   408 	$tax_name = esc_attr( $r['taxonomy'] );
       
   409 	$taxonomy = get_taxonomy( $r['taxonomy'] );
   360 	$user_can_assign_terms = current_user_can( $taxonomy->cap->assign_terms );
   410 	$user_can_assign_terms = current_user_can( $taxonomy->cap->assign_terms );
   361 	$comma = _x( ',', 'tag delimiter' );
   411 	$comma = _x( ',', 'tag delimiter' );
   362 ?>
   412 ?>
   363 <div class="tagsdiv" id="<?php echo $tax_name; ?>">
   413 <div class="tagsdiv" id="<?php echo $tax_name; ?>">
   364 	<div class="jaxtag">
   414 	<div class="jaxtag">
   366 	<p><?php echo $taxonomy->labels->add_or_remove_items; ?></p>
   416 	<p><?php echo $taxonomy->labels->add_or_remove_items; ?></p>
   367 	<textarea name="<?php echo "tax_input[$tax_name]"; ?>" rows="3" cols="20" class="the-tags" id="tax-input-<?php echo $tax_name; ?>" <?php disabled( ! $user_can_assign_terms ); ?>><?php echo str_replace( ',', $comma . ' ', get_terms_to_edit( $post->ID, $tax_name ) ); // textarea_escaped by esc_attr() ?></textarea></div>
   417 	<textarea name="<?php echo "tax_input[$tax_name]"; ?>" rows="3" cols="20" class="the-tags" id="tax-input-<?php echo $tax_name; ?>" <?php disabled( ! $user_can_assign_terms ); ?>><?php echo str_replace( ',', $comma . ' ', get_terms_to_edit( $post->ID, $tax_name ) ); // textarea_escaped by esc_attr() ?></textarea></div>
   368  	<?php if ( $user_can_assign_terms ) : ?>
   418  	<?php if ( $user_can_assign_terms ) : ?>
   369 	<div class="ajaxtag hide-if-no-js">
   419 	<div class="ajaxtag hide-if-no-js">
   370 		<label class="screen-reader-text" for="new-tag-<?php echo $tax_name; ?>"><?php echo $box['title']; ?></label>
   420 		<label class="screen-reader-text" for="new-tag-<?php echo $tax_name; ?>"><?php echo $box['title']; ?></label>
   371 		<div class="taghint"><?php echo $taxonomy->labels->add_new_item; ?></div>
       
   372 		<p><input type="text" id="new-tag-<?php echo $tax_name; ?>" name="newtag[<?php echo $tax_name; ?>]" class="newtag form-input-tip" size="16" autocomplete="off" value="" />
   421 		<p><input type="text" id="new-tag-<?php echo $tax_name; ?>" name="newtag[<?php echo $tax_name; ?>]" class="newtag form-input-tip" size="16" autocomplete="off" value="" />
   373 		<input type="button" class="button tagadd" value="<?php esc_attr_e('Add'); ?>" /></p>
   422 		<input type="button" class="button tagadd" value="<?php esc_attr_e('Add'); ?>" /></p>
   374 	</div>
   423 	</div>
   375 	<p class="howto"><?php echo $taxonomy->labels->separate_items_with_commas; ?></p>
   424 	<p class="howto"><?php echo $taxonomy->labels->separate_items_with_commas; ?></p>
   376 	<?php endif; ?>
   425 	<?php endif; ?>
   386 /**
   435 /**
   387  * Display post categories form fields.
   436  * Display post categories form fields.
   388  *
   437  *
   389  * @since 2.6.0
   438  * @since 2.6.0
   390  *
   439  *
   391  * @param object $post
   440  * @todo Create taxonomy-agnostic wrapper for this.
       
   441  *
       
   442  * @param WP_Post $post Post object.
       
   443  * @param array   $box {
       
   444  *     Categories meta box arguments.
       
   445  *
       
   446  *     @type string   $id       Meta box ID.
       
   447  *     @type string   $title    Meta box title.
       
   448  *     @type callback $callback Meta box display callback.
       
   449  *     @type array    $args {
       
   450  *         Extra meta box arguments.
       
   451  *
       
   452  *         @type string $taxonomy Taxonomy. Default 'category'.
       
   453  *     }
       
   454  * }
   392  */
   455  */
   393 function post_categories_meta_box( $post, $box ) {
   456 function post_categories_meta_box( $post, $box ) {
   394 	$defaults = array('taxonomy' => 'category');
   457 	$defaults = array( 'taxonomy' => 'category' );
   395 	if ( !isset($box['args']) || !is_array($box['args']) )
   458 	if ( ! isset( $box['args'] ) || ! is_array( $box['args'] ) ) {
   396 		$args = array();
   459 		$args = array();
   397 	else
   460 	} else {
   398 		$args = $box['args'];
   461 		$args = $box['args'];
   399 	extract( wp_parse_args($args, $defaults), EXTR_SKIP );
   462 	}
   400 	$tax = get_taxonomy($taxonomy);
   463 	$r = wp_parse_args( $args, $defaults );
   401 
   464 	$tax_name = esc_attr( $r['taxonomy'] );
       
   465 	$taxonomy = get_taxonomy( $r['taxonomy'] );
   402 	?>
   466 	?>
   403 	<div id="taxonomy-<?php echo $taxonomy; ?>" class="categorydiv">
   467 	<div id="taxonomy-<?php echo $tax_name; ?>" class="categorydiv">
   404 		<ul id="<?php echo $taxonomy; ?>-tabs" class="category-tabs">
   468 		<ul id="<?php echo $tax_name; ?>-tabs" class="category-tabs">
   405 			<li class="tabs"><a href="#<?php echo $taxonomy; ?>-all"><?php echo $tax->labels->all_items; ?></a></li>
   469 			<li class="tabs"><a href="#<?php echo $tax_name; ?>-all"><?php echo $taxonomy->labels->all_items; ?></a></li>
   406 			<li class="hide-if-no-js"><a href="#<?php echo $taxonomy; ?>-pop"><?php _e( 'Most Used' ); ?></a></li>
   470 			<li class="hide-if-no-js"><a href="#<?php echo $tax_name; ?>-pop"><?php _e( 'Most Used' ); ?></a></li>
   407 		</ul>
   471 		</ul>
   408 
   472 
   409 		<div id="<?php echo $taxonomy; ?>-pop" class="tabs-panel" style="display: none;">
   473 		<div id="<?php echo $tax_name; ?>-pop" class="tabs-panel" style="display: none;">
   410 			<ul id="<?php echo $taxonomy; ?>checklist-pop" class="categorychecklist form-no-clear" >
   474 			<ul id="<?php echo $tax_name; ?>checklist-pop" class="categorychecklist form-no-clear" >
   411 				<?php $popular_ids = wp_popular_terms_checklist($taxonomy); ?>
   475 				<?php $popular_ids = wp_popular_terms_checklist( $tax_name ); ?>
   412 			</ul>
   476 			</ul>
   413 		</div>
   477 		</div>
   414 
   478 
   415 		<div id="<?php echo $taxonomy; ?>-all" class="tabs-panel">
   479 		<div id="<?php echo $tax_name; ?>-all" class="tabs-panel">
   416 			<?php
   480 			<?php
   417             $name = ( $taxonomy == 'category' ) ? 'post_category' : 'tax_input[' . $taxonomy . ']';
   481             $name = ( $tax_name == 'category' ) ? 'post_category' : 'tax_input[' . $tax_name . ']';
   418             echo "<input type='hidden' name='{$name}[]' value='0' />"; // Allows for an empty term set to be sent. 0 is an invalid Term ID and will be ignored by empty() checks.
   482             echo "<input type='hidden' name='{$name}[]' value='0' />"; // Allows for an empty term set to be sent. 0 is an invalid Term ID and will be ignored by empty() checks.
   419             ?>
   483             ?>
   420 			<ul id="<?php echo $taxonomy; ?>checklist" data-wp-lists="list:<?php echo $taxonomy?>" class="categorychecklist form-no-clear">
   484 			<ul id="<?php echo $tax_name; ?>checklist" data-wp-lists="list:<?php echo $tax_name; ?>" class="categorychecklist form-no-clear">
   421 				<?php wp_terms_checklist($post->ID, array( 'taxonomy' => $taxonomy, 'popular_cats' => $popular_ids ) ) ?>
   485 				<?php wp_terms_checklist( $post->ID, array( 'taxonomy' => $tax_name, 'popular_cats' => $popular_ids ) ); ?>
   422 			</ul>
   486 			</ul>
   423 		</div>
   487 		</div>
   424 	<?php if ( current_user_can($tax->cap->edit_terms) ) : ?>
   488 	<?php if ( current_user_can( $taxonomy->cap->edit_terms ) ) : ?>
   425 			<div id="<?php echo $taxonomy; ?>-adder" class="wp-hidden-children">
   489 			<div id="<?php echo $tax_name; ?>-adder" class="wp-hidden-children">
   426 				<h4>
   490 				<h4>
   427 					<a id="<?php echo $taxonomy; ?>-add-toggle" href="#<?php echo $taxonomy; ?>-add" class="hide-if-no-js">
   491 					<a id="<?php echo $tax_name; ?>-add-toggle" href="#<?php echo $tax_name; ?>-add" class="hide-if-no-js">
   428 						<?php
   492 						<?php
   429 							/* translators: %s: add new taxonomy label */
   493 							/* translators: %s: add new taxonomy label */
   430 							printf( __( '+ %s' ), $tax->labels->add_new_item );
   494 							printf( __( '+ %s' ), $taxonomy->labels->add_new_item );
   431 						?>
   495 						?>
   432 					</a>
   496 					</a>
   433 				</h4>
   497 				</h4>
   434 				<p id="<?php echo $taxonomy; ?>-add" class="category-add wp-hidden-child">
   498 				<p id="<?php echo $tax_name; ?>-add" class="category-add wp-hidden-child">
   435 					<label class="screen-reader-text" for="new<?php echo $taxonomy; ?>"><?php echo $tax->labels->add_new_item; ?></label>
   499 					<label class="screen-reader-text" for="new<?php echo $tax_name; ?>"><?php echo $taxonomy->labels->add_new_item; ?></label>
   436 					<input type="text" name="new<?php echo $taxonomy; ?>" id="new<?php echo $taxonomy; ?>" class="form-required form-input-tip" value="<?php echo esc_attr( $tax->labels->new_item_name ); ?>" aria-required="true"/>
   500 					<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"/>
   437 					<label class="screen-reader-text" for="new<?php echo $taxonomy; ?>_parent">
   501 					<label class="screen-reader-text" for="new<?php echo $tax_name; ?>_parent">
   438 						<?php echo $tax->labels->parent_item_colon; ?>
   502 						<?php echo $taxonomy->labels->parent_item_colon; ?>
   439 					</label>
   503 					</label>
   440 					<?php wp_dropdown_categories( array( 'taxonomy' => $taxonomy, 'hide_empty' => 0, 'name' => 'new'.$taxonomy.'_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => '&mdash; ' . $tax->labels->parent_item . ' &mdash;' ) ); ?>
   504 					<?php wp_dropdown_categories( array( 'taxonomy' => $tax_name, 'hide_empty' => 0, 'name' => 'new' . $tax_name . '_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => '&mdash; ' . $taxonomy->labels->parent_item . ' &mdash;' ) ); ?>
   441 					<input type="button" id="<?php echo $taxonomy; ?>-add-submit" data-wp-lists="add:<?php echo $taxonomy ?>checklist:<?php echo $taxonomy ?>-add" class="button category-add-submit" value="<?php echo esc_attr( $tax->labels->add_new_item ); ?>" />
   505 					<input type="button" id="<?php echo $tax_name; ?>-add-submit" data-wp-lists="add:<?php echo $tax_name; ?>checklist:<?php echo $tax_name; ?>-add" class="button category-add-submit" value="<?php echo esc_attr( $taxonomy->labels->add_new_item ); ?>" />
   442 					<?php wp_nonce_field( 'add-'.$taxonomy, '_ajax_nonce-add-'.$taxonomy, false ); ?>
   506 					<?php wp_nonce_field( 'add-' . $tax_name, '_ajax_nonce-add-' . $tax_name, false ); ?>
   443 					<span id="<?php echo $taxonomy; ?>-ajax-response"></span>
   507 					<span id="<?php echo $tax_name; ?>-ajax-response"></span>
   444 				</p>
   508 				</p>
   445 			</div>
   509 			</div>
   446 		<?php endif; ?>
   510 		<?php endif; ?>
   447 	</div>
   511 	</div>
   448 	<?php
   512 	<?php
   456  * @param object $post
   520  * @param object $post
   457  */
   521  */
   458 function post_excerpt_meta_box($post) {
   522 function post_excerpt_meta_box($post) {
   459 ?>
   523 ?>
   460 <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>
   524 <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>
   461 <p><?php _e('Excerpts are optional hand-crafted summaries of your content that can be used in your theme. <a href="http://codex.wordpress.org/Excerpt" target="_blank">Learn more about manual excerpts.</a>'); ?></p>
   525 <p><?php _e('Excerpts are optional hand-crafted summaries of your content that can be used in your theme. <a href="https://codex.wordpress.org/Excerpt" target="_blank">Learn more about manual excerpts.</a>'); ?></p>
   462 <?php
   526 <?php
   463 }
   527 }
   464 
   528 
   465 /**
   529 /**
   466  * Display trackback links form fields.
   530  * Display trackback links form fields.
   480 		$pings .= '</ul>';
   544 		$pings .= '</ul>';
   481 	}
   545 	}
   482 
   546 
   483 ?>
   547 ?>
   484 <p><label for="trackback_url"><?php _e('Send trackbacks to:'); ?></label> <?php echo $form_trackback; ?><br /> (<?php _e('Separate multiple URLs with spaces'); ?>)</p>
   548 <p><label for="trackback_url"><?php _e('Send trackbacks to:'); ?></label> <?php echo $form_trackback; ?><br /> (<?php _e('Separate multiple URLs with spaces'); ?>)</p>
   485 <p><?php _e('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="http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments" target="_blank">pingbacks</a>, no other action necessary.'); ?></p>
   549 <p><?php _e('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="https://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments" target="_blank">pingbacks</a>, no other action necessary.'); ?></p>
   486 <?php
   550 <?php
   487 if ( ! empty($pings) )
   551 if ( ! empty($pings) )
   488 	echo $pings;
   552 	echo $pings;
   489 }
   553 }
   490 
   554 
   506 		unset( $metadata[ $key ] );
   570 		unset( $metadata[ $key ] );
   507 }
   571 }
   508 list_meta( $metadata );
   572 list_meta( $metadata );
   509 meta_form( $post ); ?>
   573 meta_form( $post ); ?>
   510 </div>
   574 </div>
   511 <p><?php _e('Custom fields can be used to add extra metadata to a post that you can <a href="http://codex.wordpress.org/Using_Custom_Fields" target="_blank">use in your theme</a>.'); ?></p>
   575 <p><?php _e('Custom fields can be used to add extra metadata to a post that you can <a href="https://codex.wordpress.org/Using_Custom_Fields" target="_blank">use in your theme</a>.'); ?></p>
   512 <?php
   576 <?php
   513 }
   577 }
   514 
   578 
   515 /**
   579 /**
   516  * Display comments status form fields.
   580  * Display comments status form fields.
   522 function post_comment_status_meta_box($post) {
   586 function post_comment_status_meta_box($post) {
   523 ?>
   587 ?>
   524 <input name="advanced_view" type="hidden" value="1" />
   588 <input name="advanced_view" type="hidden" value="1" />
   525 <p class="meta-options">
   589 <p class="meta-options">
   526 	<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 />
   590 	<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 />
   527 	<label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked($post->ping_status, 'open'); ?> /> <?php printf( __( 'Allow <a href="%s" target="_blank">trackbacks and pingbacks</a> on this page.' ), __( 'http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments' ) ); ?></label>
   591 	<label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked($post->ping_status, 'open'); ?> /> <?php printf( __( 'Allow <a href="%s" target="_blank">trackbacks and pingbacks</a> on this page.' ), __( 'https://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments' ) ); ?></label>
   528 	<?php do_action('post_comment_status_meta_box-options', $post); ?>
   592 	<?php
       
   593 	/**
       
   594 	 * Fires at the end of the Discussion meta box on the post editing screen.
       
   595 	 *
       
   596 	 * @since 3.1.0
       
   597 	 *
       
   598 	 * @param WP_Post $post WP_Post object of the current post.
       
   599 	 */
       
   600 	do_action( 'post_comment_status_meta_box-options', $post );
       
   601 	?>
   529 </p>
   602 </p>
   530 <?php
   603 <?php
   531 }
   604 }
   532 
   605 
   533 /**
   606 /**
   549  * @since 2.8.0
   622  * @since 2.8.0
   550  *
   623  *
   551  * @param object $post
   624  * @param object $post
   552  */
   625  */
   553 function post_comment_meta_box( $post ) {
   626 function post_comment_meta_box( $post ) {
   554 	global $wpdb;
       
   555 
       
   556 	wp_nonce_field( 'get-comments', 'add_comment_nonce', false );
   627 	wp_nonce_field( 'get-comments', 'add_comment_nonce', false );
   557 	?>
   628 	?>
   558 	<p class="hide-if-no-js" id="add-new-comment"><a href="#commentstatusdiv" onclick="commentReply.addcomment(<?php echo $post->ID; ?>);return false;"><?php _e('Add comment'); ?></a></p>
   629 	<p class="hide-if-no-js" id="add-new-comment"><a class="button" href="#commentstatusdiv" onclick="window.commentReply && commentReply.addcomment(<?php echo $post->ID; ?>);return false;"><?php _e('Add comment'); ?></a></p>
   559 	<?php
   630 	<?php
   560 
   631 
   561 	$total = get_comments( array( 'post_id' => $post->ID, 'number' => 1, 'count' => true ) );
   632 	$total = get_comments( array( 'post_id' => $post->ID, 'number' => 1, 'count' => true ) );
   562 	$wp_list_table = _get_list_table('WP_Post_Comments_List_Table');
   633 	$wp_list_table = _get_list_table('WP_Post_Comments_List_Table');
   563 	$wp_list_table->display( true );
   634 	$wp_list_table->display( true );
   586  * @since 2.6.0
   657  * @since 2.6.0
   587  *
   658  *
   588  * @param object $post
   659  * @param object $post
   589  */
   660  */
   590 function post_slug_meta_box($post) {
   661 function post_slug_meta_box($post) {
   591 ?>
   662 /** This filter is documented in wp-admin/edit-tag-form.php */
   592 <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( apply_filters('editable_slug', $post->post_name) ); ?>" />
   663 ?>
       
   664 <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( apply_filters( 'editable_slug', $post->post_name ) ); ?>" />
   593 <?php
   665 <?php
   594 }
   666 }
   595 
   667 
   596 /**
   668 /**
   597  * Display form field with list of authors.
   669  * Display form field with list of authors.
   644 			'show_option_none' => __('(no parent)'),
   716 			'show_option_none' => __('(no parent)'),
   645 			'sort_column'      => 'menu_order, post_title',
   717 			'sort_column'      => 'menu_order, post_title',
   646 			'echo'             => 0,
   718 			'echo'             => 0,
   647 		);
   719 		);
   648 
   720 
       
   721 		/**
       
   722 		 * Filter the arguments used to generate a Pages drop-down element.
       
   723 		 *
       
   724 		 * @since 3.3.0
       
   725 		 *
       
   726 		 * @see wp_dropdown_pages()
       
   727 		 *
       
   728 		 * @param array   $dropdown_args Array of arguments used to generate the pages drop-down.
       
   729 		 * @param WP_Post $post          The current WP_Post object.
       
   730 		 */
   649 		$dropdown_args = apply_filters( 'page_attributes_dropdown_pages_args', $dropdown_args, $post );
   731 		$dropdown_args = apply_filters( 'page_attributes_dropdown_pages_args', $dropdown_args, $post );
   650 		$pages = wp_dropdown_pages( $dropdown_args );
   732 		$pages = wp_dropdown_pages( $dropdown_args );
   651 		if ( ! empty($pages) ) {
   733 		if ( ! empty($pages) ) {
   652 ?>
   734 ?>
   653 <p><strong><?php _e('Parent') ?></strong></p>
   735 <p><strong><?php _e('Parent') ?></strong></p>
   654 <label class="screen-reader-text" for="parent_id"><?php _e('Parent') ?></label>
   736 <label class="screen-reader-text" for="parent_id"><?php _e('Parent') ?></label>
   655 <?php echo $pages; ?>
   737 <?php echo $pages; ?>
   656 <?php
   738 <?php
   657 		} // end empty pages check
   739 		} // end empty pages check
   658 	} // end hierarchical check.
   740 	} // end hierarchical check.
   659 	if ( 'page' == $post->post_type && 0 != count( get_page_templates() ) ) {
   741 	if ( 'page' == $post->post_type && 0 != count( get_page_templates( $post ) ) && get_option( 'page_for_posts' ) != $post->ID ) {
   660 		$template = !empty($post->page_template) ? $post->page_template : false;
   742 		$template = !empty($post->page_template) ? $post->page_template : false;
   661 		?>
   743 		?>
   662 <p><strong><?php _e('Template') ?></strong></p>
   744 <p><strong><?php _e('Template') ?></strong></p>
   663 <label class="screen-reader-text" for="page_template"><?php _e('Page Template') ?></label><select name="page_template" id="page_template">
   745 <label class="screen-reader-text" for="page_template"><?php _e('Page Template') ?></label><select name="page_template" id="page_template">
   664 <option value='default'><?php _e('Default Template'); ?></option>
   746 <?php
       
   747 /**
       
   748  * Filter the title of the default page template displayed in the drop-down.
       
   749  *
       
   750  * @since 4.1.0
       
   751  *
       
   752  * @param string $label   The display value for the default page template title.
       
   753  * @param string $context Where the option label is displayed. Possible values
       
   754  *                        include 'meta-box' or 'quick-edit'.
       
   755  */
       
   756 $default_title = apply_filters( 'default_page_template_title',  __( 'Default Template' ), 'meta-box' );
       
   757 ?>
       
   758 <option value="default"><?php echo esc_html( $default_title ); ?></option>
   665 <?php page_template_dropdown($template); ?>
   759 <?php page_template_dropdown($template); ?>
   666 </select>
   760 </select>
   667 <?php
   761 <?php
   668 	} ?>
   762 	} ?>
   669 <p><strong><?php _e('Order') ?></strong></p>
   763 <p><strong><?php _e('Order') ?></strong></p>
   670 <p><label class="screen-reader-text" for="menu_order"><?php _e('Order') ?></label><input name="menu_order" type="text" size="4" id="menu_order" value="<?php echo esc_attr($post->menu_order) ?>" /></p>
   764 <p><label class="screen-reader-text" for="menu_order"><?php _e('Order') ?></label><input name="menu_order" type="text" size="4" id="menu_order" value="<?php echo esc_attr($post->menu_order) ?>" /></p>
   671 <p><?php if ( 'page' == $post->post_type ) _e( 'Need help? Use the Help tab in the upper right of your screen.' ); ?></p>
   765 <?php if ( 'page' == $post->post_type && get_current_screen()->get_help_tabs() ) { ?>
   672 <?php
   766 <p><?php _e( 'Need help? Use the Help tab in the upper right of your screen.' ); ?></p>
       
   767 <?php
       
   768 	}
   673 }
   769 }
   674 
   770 
   675 // -- Link related Meta Boxes
   771 // -- Link related Meta Boxes
   676 
   772 
   677 /**
   773 /**
   708 </div>
   804 </div>
   709 
   805 
   710 </div>
   806 </div>
   711 
   807 
   712 <div id="major-publishing-actions">
   808 <div id="major-publishing-actions">
   713 <?php do_action('post_submitbox_start'); ?>
   809 <?php
       
   810 /** This action is documented in wp-admin/includes/meta-boxes.php */
       
   811 do_action( 'post_submitbox_start' );
       
   812 ?>
   714 <div id="delete-action">
   813 <div id="delete-action">
   715 <?php
   814 <?php
   716 if ( !empty($_GET['action']) && 'edit' == $_GET['action'] && current_user_can('manage_links') ) { ?>
   815 if ( !empty($_GET['action']) && 'edit' == $_GET['action'] && current_user_can('manage_links') ) { ?>
   717 	<a class="submitdelete deletion" href="<?php echo wp_nonce_url("link.php?action=delete&amp;link_id=$link->link_id", 'delete-bookmark_' . $link->link_id); ?>" onclick="if ( confirm('<?php echo esc_js(sprintf(__("You are about to delete this link '%s'\n 'Cancel' to stop, 'OK' to delete."), $link->link_name )); ?>') ) {return true;}return false;"><?php _e('Delete'); ?></a>
   816 	<a class="submitdelete deletion" href="<?php echo wp_nonce_url("link.php?action=delete&amp;link_id=$link->link_id", 'delete-bookmark_' . $link->link_id); ?>" onclick="if ( confirm('<?php echo esc_js(sprintf(__("You are about to delete this link '%s'\n 'Cancel' to stop, 'OK' to delete."), $link->link_name )); ?>') ) {return true;}return false;"><?php _e('Delete'); ?></a>
   718 <?php } ?>
   817 <?php } ?>
   719 </div>
   818 </div>
   720 
   819 
   721 <div id="publishing-action">
   820 <div id="publishing-action">
   722 <?php if ( !empty($link->link_id) ) { ?>
   821 <?php if ( !empty($link->link_id) ) { ?>
   723 	<input name="save" type="submit" class="button-large button-primary" id="publish" accesskey="p" value="<?php esc_attr_e('Update Link') ?>" />
   822 	<input name="save" type="submit" class="button-large button-primary" id="publish" value="<?php esc_attr_e( 'Update Link' ) ?>" />
   724 <?php } else { ?>
   823 <?php } else { ?>
   725 	<input name="save" type="submit" class="button-large button-primary" id="publish" accesskey="p" value="<?php esc_attr_e('Add Link') ?>" />
   824 	<input name="save" type="submit" class="button-large button-primary" id="publish" value="<?php esc_attr_e( 'Add Link' ) ?>" />
   726 <?php } ?>
   825 <?php } ?>
   727 </div>
   826 </div>
   728 <div class="clear"></div>
   827 <div class="clear"></div>
   729 </div>
   828 </div>
   730 <?php do_action('submitlink_box'); ?>
   829 <?php
       
   830 /**
       
   831  * Fires at the end of the Publish box in the Link editing screen.
       
   832  *
       
   833  * @since 2.5.0
       
   834  */
       
   835 do_action( 'submitlink_box' );
       
   836 ?>
   731 <div class="clear"></div>
   837 <div class="clear"></div>
   732 </div>
   838 </div>
   733 <?php
   839 <?php
   734 }
   840 }
   735 
   841 
   839  *
   945  *
   840  * @param object $link
   946  * @param object $link
   841  */
   947  */
   842 function link_xfn_meta_box($link) {
   948 function link_xfn_meta_box($link) {
   843 ?>
   949 ?>
   844 <table class="links-table" cellspacing="0">
   950 <table class="links-table">
   845 	<tr>
   951 	<tr>
   846 		<th scope="row"><label for="link_rel"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('rel:') ?></label></th>
   952 		<th scope="row"><label for="link_rel"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('rel:') ?></label></th>
   847 		<td><input type="text" name="link_rel" id="link_rel" value="<?php echo ( isset( $link->link_rel ) ? esc_attr($link->link_rel) : ''); ?>" /></td>
   953 		<td><input type="text" name="link_rel" id="link_rel" value="<?php echo ( isset( $link->link_rel ) ? esc_attr($link->link_rel) : ''); ?>" /></td>
   848 	</tr>
   954 	</tr>
   849 	<tr>
   955 	<tr>
   996  */
  1102  */
   997 function post_thumbnail_meta_box( $post ) {
  1103 function post_thumbnail_meta_box( $post ) {
   998 	$thumbnail_id = get_post_meta( $post->ID, '_thumbnail_id', true );
  1104 	$thumbnail_id = get_post_meta( $post->ID, '_thumbnail_id', true );
   999 	echo _wp_post_thumbnail_html( $thumbnail_id, $post->ID );
  1105 	echo _wp_post_thumbnail_html( $thumbnail_id, $post->ID );
  1000 }
  1106 }
       
  1107 
       
  1108 /**
       
  1109  * Display fields for ID3 data
       
  1110  *
       
  1111  * @since 3.9.0
       
  1112  *
       
  1113  * @param WP_Post $post
       
  1114  */
       
  1115 function attachment_id3_data_meta_box( $post ) {
       
  1116 	$meta = array();
       
  1117 	if ( ! empty( $post->ID ) ) {
       
  1118 		$meta = wp_get_attachment_metadata( $post->ID );
       
  1119 	}
       
  1120 
       
  1121 	foreach ( wp_get_attachment_id3_keys( $post, 'edit' ) as $key => $label ) : ?>
       
  1122 	<p>
       
  1123 		<label for="title"><?php echo $label ?></label><br />
       
  1124 		<input type="text" name="id3_<?php echo esc_attr( $key ) ?>" id="id3_<?php echo esc_attr( $key ) ?>" class="large-text" value="<?php
       
  1125 			if ( ! empty( $meta[ $key ] ) ) {
       
  1126 				echo esc_attr( $meta[ $key ] );
       
  1127 			}
       
  1128 		?>" />
       
  1129 	</p>
       
  1130 	<?php
       
  1131 	endforeach;
       
  1132 }