Changeset 42343 for trunk/src/wp-admin/includes/meta-boxes.php
- Timestamp:
- 11/30/2017 11:09:33 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/meta-boxes.php
r42228 r42343 23 23 global $action; 24 24 25 $post_type = $post->post_type;26 $post_type_object = get_post_type_object( $post_type);27 $can_publish = current_user_can($post_type_object->cap->publish_posts);25 $post_type = $post->post_type; 26 $post_type_object = get_post_type_object( $post_type ); 27 $can_publish = current_user_can( $post_type_object->cap->publish_posts ); 28 28 ?> 29 29 <div class="submitbox" id="submitpost"> … … 39 39 <div id="save-action"> 40 40 <?php 41 42 43 44 45 46 ?> 47 <input <?php echo $private_style; ?> type="submit" name="save" id="save-post" value="<?php esc_attr_e( 'Save Draft'); ?>" class="button" />41 if ( 'publish' != $post->post_status && 'future' != $post->post_status && 'pending' != $post->post_status ) { 42 $private_style = ''; 43 if ( 'private' == $post->post_status ) { 44 $private_style = 'style="display:none"'; 45 } 46 ?> 47 <input <?php echo $private_style; ?> type="submit" name="save" id="save-post" value="<?php esc_attr_e( 'Save Draft' ); ?>" class="button" /> 48 48 <span class="spinner"></span> 49 49 <?php } elseif ( 'pending' == $post->post_status && $can_publish ) { ?> 50 <input type="submit" name="save" id="save-post" value="<?php esc_attr_e( 'Save as Pending'); ?>" class="button" />50 <input type="submit" name="save" id="save-post" value="<?php esc_attr_e( 'Save as Pending' ); ?>" class="button" /> 51 51 <span class="spinner"></span> 52 52 <?php } ?> … … 62 62 } 63 63 64 $preview_button = sprintf( '%1$s<span class="screen-reader-text"> %2$s</span>', 64 $preview_button = sprintf( 65 '%1$s<span class="screen-reader-text"> %2$s</span>', 65 66 $preview_button_text, 66 67 /* translators: accessibility text */ … … 88 89 89 90 <div class="misc-pub-section misc-pub-post-status"> 90 <?php _e( 'Status:' ) ?> <span id="post-status-display"><?php 91 92 switch ( $post->post_status ) { 93 case 'private': 94 _e('Privately Published'); 95 break; 96 case 'publish': 97 _e('Published'); 98 break; 99 case 'future': 100 _e('Scheduled'); 101 break; 102 case 'pending': 103 _e('Pending Review'); 104 break; 105 case 'draft': 106 case 'auto-draft': 107 _e('Draft'); 108 break; 109 } 91 <?php _e( 'Status:' ); ?> <span id="post-status-display"> 92 <?php 93 94 switch ( $post->post_status ) { 95 case 'private': 96 _e( 'Privately Published' ); 97 break; 98 case 'publish': 99 _e( 'Published' ); 100 break; 101 case 'future': 102 _e( 'Scheduled' ); 103 break; 104 case 'pending': 105 _e( 'Pending Review' ); 106 break; 107 case 'draft': 108 case 'auto-draft': 109 _e( 'Draft' ); 110 break; 111 } 110 112 ?> 111 113 </span> 112 114 <?php 113 114 115 116 117 115 if ( 'publish' == $post->post_status || 'private' == $post->post_status || $can_publish ) { 116 $private_style = ''; 117 if ( 'private' == $post->post_status ) { 118 $private_style = 'style="display:none"'; 119 } 118 120 ?> 119 121 <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> 120 122 121 123 <div id="post-status-select" class="hide-if-js"> 122 <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); ?>" />123 <label for="post_status" class="screen-reader-text"><?php _e( 'Set status' ) ?></label>124 <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 ); ?>" /> 125 <label for="post_status" class="screen-reader-text"><?php _e( 'Set status' ); ?></label> 124 126 <select name="post_status" id="post_status"> 125 127 <?php if ( 'publish' == $post->post_status ) : ?> 126 <option<?php selected( $post->post_status, 'publish' ); ?> value='publish'><?php _e( 'Published')?></option>128 <option<?php selected( $post->post_status, 'publish' ); ?> value='publish'><?php _e( 'Published' ); ?></option> 127 129 <?php elseif ( 'private' == $post->post_status ) : ?> 128 <option<?php selected( $post->post_status, 'private' ); ?> value='publish'><?php _e( 'Privately Published')?></option>130 <option<?php selected( $post->post_status, 'private' ); ?> value='publish'><?php _e( 'Privately Published' ); ?></option> 129 131 <?php elseif ( 'future' == $post->post_status ) : ?> 130 <option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e( 'Scheduled')?></option>132 <option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e( 'Scheduled' ); ?></option> 131 133 <?php endif; ?> 132 <option<?php selected( $post->post_status, 'pending' ); ?> value='pending'><?php _e( 'Pending Review')?></option>134 <option<?php selected( $post->post_status, 'pending' ); ?> value='pending'><?php _e( 'Pending Review' ); ?></option> 133 135 <?php if ( 'auto-draft' == $post->post_status ) : ?> 134 <option<?php selected( $post->post_status, 'auto-draft' ); ?> value='draft'><?php _e( 'Draft')?></option>136 <option<?php selected( $post->post_status, 'auto-draft' ); ?> value='draft'><?php _e( 'Draft' ); ?></option> 135 137 <?php else : ?> 136 <option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e( 'Draft')?></option>138 <option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e( 'Draft' ); ?></option> 137 139 <?php endif; ?> 138 140 </select> 139 <a href="#post_status" class="save-post-status hide-if-no-js button"><?php _e( 'OK'); ?></a>140 <a href="#post_status" class="cancel-post-status hide-if-no-js button-cancel"><?php _e( 'Cancel'); ?></a>141 <a href="#post_status" class="save-post-status hide-if-no-js button"><?php _e( 'OK' ); ?></a> 142 <a href="#post_status" class="cancel-post-status hide-if-no-js button-cancel"><?php _e( 'Cancel' ); ?></a> 141 143 </div> 142 144 … … 145 147 146 148 <div class="misc-pub-section misc-pub-visibility" id="visibility"> 147 <?php _e('Visibility:'); ?> <span id="post-visibility-display"><?php 148 149 if ( 'private' == $post->post_status ) { 150 $post->post_password = ''; 151 $visibility = 'private'; 152 $visibility_trans = __('Private'); 153 } elseif ( !empty( $post->post_password ) ) { 154 $visibility = 'password'; 155 $visibility_trans = __('Password protected'); 156 } elseif ( $post_type == 'post' && is_sticky( $post->ID ) ) { 157 $visibility = 'public'; 158 $visibility_trans = __('Public, Sticky'); 159 } else { 160 $visibility = 'public'; 161 $visibility_trans = __('Public'); 162 } 163 164 echo esc_html( $visibility_trans ); ?></span> 149 <?php _e( 'Visibility:' ); ?> <span id="post-visibility-display"> 150 <?php 151 152 if ( 'private' == $post->post_status ) { 153 $post->post_password = ''; 154 $visibility = 'private'; 155 $visibility_trans = __( 'Private' ); 156 } elseif ( ! empty( $post->post_password ) ) { 157 $visibility = 'password'; 158 $visibility_trans = __( 'Password protected' ); 159 } elseif ( $post_type == 'post' && is_sticky( $post->ID ) ) { 160 $visibility = 'public'; 161 $visibility_trans = __( 'Public, Sticky' ); 162 } else { 163 $visibility = 'public'; 164 $visibility_trans = __( 'Public' ); 165 } 166 167 echo esc_html( $visibility_trans ); 168 ?> 169 </span> 165 170 <?php if ( $can_publish ) { ?> 166 171 <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> 167 172 168 173 <div id="post-visibility-select" class="hide-if-js"> 169 <input type="hidden" name="hidden_post_password" id="hidden-post-password" value="<?php echo esc_attr( $post->post_password); ?>" />170 <?php if ( $post_type == 'post'): ?>171 <input type="checkbox" style="display:none" name="hidden_post_sticky" id="hidden-post-sticky" value="sticky" <?php checked( is_sticky($post->ID)); ?> />174 <input type="hidden" name="hidden_post_password" id="hidden-post-password" value="<?php echo esc_attr( $post->post_password ); ?>" /> 175 <?php if ( $post_type == 'post' ) : ?> 176 <input type="checkbox" style="display:none" name="hidden_post_sticky" id="hidden-post-sticky" value="sticky" <?php checked( is_sticky( $post->ID ) ); ?> /> 172 177 <?php endif; ?> 173 178 <input type="hidden" name="hidden_post_visibility" id="hidden-post-visibility" value="<?php echo esc_attr( $visibility ); ?>" /> 174 <input type="radio" name="visibility" id="visibility-radio-public" value="public" <?php checked( $visibility, 'public' ); ?> /> <label for="visibility-radio-public" class="selectit"><?php _e( 'Public'); ?></label><br />179 <input type="radio" name="visibility" id="visibility-radio-public" value="public" <?php checked( $visibility, 'public' ); ?> /> <label for="visibility-radio-public" class="selectit"><?php _e( 'Public' ); ?></label><br /> 175 180 <?php if ( $post_type == 'post' && current_user_can( 'edit_others_posts' ) ) : ?> 176 181 <span id="sticky-span"><input id="sticky" name="sticky" type="checkbox" value="sticky" <?php checked( is_sticky( $post->ID ) ); ?> /> <label for="sticky" class="selectit"><?php _e( 'Stick this post to the front page' ); ?></label><br /></span> 177 182 <?php endif; ?> 178 <input type="radio" name="visibility" id="visibility-radio-password" value="password" <?php checked( $visibility, 'password' ); ?> /> <label for="visibility-radio-password" class="selectit"><?php _e( 'Password protected'); ?></label><br />179 <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="255" /><br /></span>180 <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 />183 <input type="radio" name="visibility" id="visibility-radio-password" value="password" <?php checked( $visibility, 'password' ); ?> /> <label for="visibility-radio-password" class="selectit"><?php _e( 'Password protected' ); ?></label><br /> 184 <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="255" /><br /></span> 185 <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 /> 181 186 182 187 <p> 183 <a href="#visibility" class="save-post-visibility hide-if-no-js button"><?php _e( 'OK'); ?></a>184 <a href="#visibility" class="cancel-post-visibility hide-if-no-js button-cancel"><?php _e( 'Cancel'); ?></a>188 <a href="#visibility" class="save-post-visibility hide-if-no-js button"><?php _e( 'OK' ); ?></a> 189 <a href="#visibility" class="cancel-post-visibility hide-if-no-js button-cancel"><?php _e( 'Cancel' ); ?></a> 185 190 </p> 186 191 </div> … … 195 200 if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date 196 201 /* translators: Post date information. 1: Date on which the post is currently scheduled to be published */ 197 $stamp = __( 'Scheduled for: <b>%1$s</b>');202 $stamp = __( 'Scheduled for: <b>%1$s</b>' ); 198 203 } elseif ( 'publish' == $post->post_status || 'private' == $post->post_status ) { // already published 199 204 /* translators: Post date information. 1: Date on which the post was published */ 200 $stamp = __( 'Published on: <b>%1$s</b>');205 $stamp = __( 'Published on: <b>%1$s</b>' ); 201 206 } elseif ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified 202 $stamp = __( 'Publish <b>immediately</b>');207 $stamp = __( 'Publish <b>immediately</b>' ); 203 208 } elseif ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) { // draft, 1 or more saves, future date specified 204 209 /* translators: Post date information. 1: Date on which the post is to be published */ 205 $stamp = __( 'Schedule for: <b>%1$s</b>');210 $stamp = __( 'Schedule for: <b>%1$s</b>' ); 206 211 } else { // draft, 1 or more saves, date specified 207 212 /* translators: Post date information. 1: Date on which the post is to be published */ 208 $stamp = __( 'Publish on: <b>%1$s</b>');213 $stamp = __( 'Publish on: <b>%1$s</b>' ); 209 214 } 210 215 $date = date_i18n( $datef, strtotime( $post->post_date ) ); 211 216 } else { // draft (no saves, and thus no date specified) 212 $stamp = __('Publish <b>immediately</b>'); 213 $date = date_i18n( $datef, strtotime( current_time('mysql') ) ); 214 } 215 216 if ( ! empty( $args['args']['revisions_count'] ) ) : ?> 217 $stamp = __( 'Publish <b>immediately</b>' ); 218 $date = date_i18n( $datef, strtotime( current_time( 'mysql' ) ) ); 219 } 220 221 if ( ! empty( $args['args']['revisions_count'] ) ) : 222 ?> 217 223 <div class="misc-pub-section misc-pub-revisions"> 218 224 <?php … … 222 228 <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> 223 229 </div> 224 <?php endif; 225 226 if ( $can_publish ) : // Contributors don't get to choose the date of publish ?> 230 <?php 231 endif; 232 233 if ( $can_publish ) : // Contributors don't get to choose the date of publish 234 ?> 227 235 <div class="misc-pub-section curtime misc-pub-curtime"> 228 236 <span id="timestamp"> 229 <?php printf( $stamp, $date); ?></span>237 <?php printf( $stamp, $date ); ?></span> 230 238 <a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" role="button"><span aria-hidden="true"><?php _e( 'Edit' ); ?></span> <span class="screen-reader-text"><?php _e( 'Edit date and time' ); ?></span></a> 231 239 <fieldset id="timestampdiv" class="hide-if-js"> … … 286 294 <div id="delete-action"> 287 295 <?php 288 if ( current_user_can( "delete_post", $post->ID ) ) { 289 if ( !EMPTY_TRASH_DAYS ) 290 $delete_text = __('Delete Permanently'); 291 else 292 $delete_text = __('Move to Trash'); 296 if ( current_user_can( 'delete_post', $post->ID ) ) { 297 if ( ! EMPTY_TRASH_DAYS ) { 298 $delete_text = __( 'Delete Permanently' ); 299 } else { 300 $delete_text = __( 'Move to Trash' ); 301 } 293 302 ?> 294 <a class="submitdelete deletion" href="<?php echo get_delete_post_link($post->ID); ?>"><?php echo $delete_text; ?></a><?php 295 } ?> 303 <a class="submitdelete deletion" href="<?php echo get_delete_post_link( $post->ID ); ?>"><?php echo $delete_text; ?></a> 304 <?php 305 } 306 ?> 296 307 </div> 297 308 … … 299 310 <span class="spinner"></span> 300 311 <?php 301 if ( ! in_array( $post->post_status, array('publish', 'future', 'private') ) || 0 == $post->ID ) {312 if ( ! in_array( $post->post_status, array( 'publish', 'future', 'private' ) ) || 0 == $post->ID ) { 302 313 if ( $can_publish ) : 303 if ( !empty($post->post_date_gmt) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : ?> 314 if ( ! empty( $post->post_date_gmt ) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : 315 ?> 304 316 <input name="original_publish" type="hidden" id="original_publish" value="<?php echo esc_attr_x( 'Schedule', 'post action/button label' ); ?>" /> 305 317 <?php submit_button( _x( 'Schedule', 'post action/button label' ), 'primary large', 'publish', false ); ?> 306 318 <?php else : ?> 307 <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e( 'Publish')?>" />319 <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e( 'Publish' ); ?>" /> 308 320 <?php submit_button( __( 'Publish' ), 'primary large', 'publish', false ); ?> 309 <?php endif; 310 else : ?> 311 <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Submit for Review') ?>" /> 321 <?php 322 endif; 323 else : 324 ?> 325 <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e( 'Submit for Review' ); ?>" /> 312 326 <?php submit_button( __( 'Submit for Review' ), 'primary large', 'publish', false ); ?> 313 327 <?php 314 328 endif; 315 } else { ?> 316 <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Update') ?>" /> 317 <input name="save" type="submit" class="button button-primary button-large" id="publish" value="<?php esc_attr_e( 'Update' ) ?>" /> 318 <?php 319 } ?> 329 } else { 330 ?> 331 <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e( 'Update' ); ?>" /> 332 <input name="save" type="submit" class="button button-primary button-large" id="publish" value="<?php esc_attr_e( 'Update' ); ?>" /> 333 <?php 334 } 335 ?> 320 336 </div> 321 337 <div class="clear"></div> … … 347 363 <div id="misc-publishing-actions"> 348 364 <div class="misc-pub-section curtime misc-pub-curtime"> 349 <span id="timestamp"><?php 365 <span id="timestamp"> 366 <?php 350 367 $date = date_i18n( 351 368 /* translators: Publish box date format, see https://secure.php.net/date */ … … 353 370 strtotime( $post->post_date ) 354 371 ); 355 printf( 356 /* translators: Attachment information. %s: Date the attachment was uploaded */ 357 __( 'Uploaded on: %s' ), 358 '<b>' . $date . '</b>' 359 ); 360 ?></span> 372 printf( 373 /* translators: Attachment information. %s: Date the attachment was uploaded */ 374 __( 'Uploaded on: %s' ), 375 '<b>' . $date . '</b>' 376 ); 377 ?> 378 </span> 361 379 </div><!-- .misc-pub-section --> 362 380 … … 369 387 * @since 4.9.0 Added the `$post` parameter. 370 388 * 371 * @param WP_Post $post WP_Post object for the current attachment. 389 * @param WP_Post $post WP_Post object for the current attachment. 372 390 */ 373 391 do_action( 'attachment_submitbox_misc_actions', $post ); … … 380 398 <div id="delete-action"> 381 399 <?php 382 if ( current_user_can( 'delete_post', $post->ID ) ) 400 if ( current_user_can( 'delete_post', $post->ID ) ) { 383 401 if ( EMPTY_TRASH_DAYS && MEDIA_TRASH ) { 384 echo "<a class='submitdelete deletion' href='" . get_delete_post_link( $post->ID ) . "'>" . _x( 'Trash', 'verb' ) . "</a>";402 echo "<a class='submitdelete deletion' href='" . get_delete_post_link( $post->ID ) . "'>" . _x( 'Trash', 'verb' ) . '</a>'; 385 403 } else { 386 404 $delete_ays = ! MEDIA_TRASH ? " onclick='return showNotice.warn();'" : ''; 387 echo "<a class='submitdelete deletion'$delete_ays href='" . get_delete_post_link( $post->ID, null, true ) . "'>" . __( 'Delete Permanently' ) . "</a>";405 echo "<a class='submitdelete deletion'$delete_ays href='" . get_delete_post_link( $post->ID, null, true ) . "'>" . __( 'Delete Permanently' ) . '</a>'; 388 406 } 407 } 389 408 ?> 390 409 </div> … … 392 411 <div id="publishing-action"> 393 412 <span class="spinner"></span> 394 <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e( 'Update')?>" />395 <input name="save" type="submit" class="button button-primary button-large" id="publish" value="<?php esc_attr_e( 'Update' ) ?>" />413 <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e( 'Update' ); ?>" /> 414 <input name="save" type="submit" class="button button-primary button-large" id="publish" value="<?php esc_attr_e( 'Update' ); ?>" /> 396 415 </div> 397 416 <div class="clear"></div> … … 420 439 function post_format_meta_box( $post, $box ) { 421 440 if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post->post_type, 'post-formats' ) ) : 422 $post_formats = get_theme_support( 'post-formats' ); 423 424 if ( is_array( $post_formats[0] ) ) : 425 $post_format = get_post_format( $post->ID ); 426 if ( !$post_format ) 427 $post_format = '0'; 428 // Add in the current one if it isn't there yet, in case the current theme doesn't support it 429 if ( $post_format && !in_array( $post_format, $post_formats[0] ) ) 430 $post_formats[0][] = $post_format; 431 ?> 432 <div id="post-formats-select"> 441 $post_formats = get_theme_support( 'post-formats' ); 442 443 if ( is_array( $post_formats[0] ) ) : 444 $post_format = get_post_format( $post->ID ); 445 if ( ! $post_format ) { 446 $post_format = '0'; 447 } 448 // Add in the current one if it isn't there yet, in case the current theme doesn't support it 449 if ( $post_format && ! in_array( $post_format, $post_formats[0] ) ) { 450 $post_formats[0][] = $post_format; 451 } 452 ?> 453 <div id="post-formats-select"> 433 454 <fieldset> 434 455 <legend class="screen-reader-text"><?php _e( 'Post Formats' ); ?></legend> … … 439 460 </fieldset> 440 461 </div> 441 <?php endif; endif; 462 <?php 463 endif; 464 endif; 442 465 } 443 466 … … 470 493 $args = $box['args']; 471 494 } 472 $r = wp_parse_args( $args, $defaults );473 $tax_name = esc_attr( $r['taxonomy'] );474 $taxonomy = get_taxonomy( $r['taxonomy'] );495 $r = wp_parse_args( $args, $defaults ); 496 $tax_name = esc_attr( $r['taxonomy'] ); 497 $taxonomy = get_taxonomy( $r['taxonomy'] ); 475 498 $user_can_assign_terms = current_user_can( $taxonomy->cap->assign_terms ); 476 $comma = _x( ',', 'tag delimiter' );477 $terms_to_edit = get_terms_to_edit( $post->ID, $tax_name );499 $comma = _x( ',', 'tag delimiter' ); 500 $terms_to_edit = get_terms_to_edit( $post->ID, $tax_name ); 478 501 if ( ! is_string( $terms_to_edit ) ) { 479 502 $terms_to_edit = ''; … … 486 509 <p><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 ); ?> aria-describedby="new-tag-<?php echo $tax_name; ?>-desc"><?php echo str_replace( ',', $comma . ' ', $terms_to_edit ); // textarea_escaped by esc_attr() ?></textarea></p> 487 510 </div> 488 511 <?php if ( $user_can_assign_terms ) : ?> 489 512 <div class="ajaxtag hide-if-no-js"> 490 513 <label class="screen-reader-text" for="new-tag-<?php echo $tax_name; ?>"><?php echo $taxonomy->labels->add_new_item; ?></label> 491 514 <p><input data-wp-taxonomy="<?php echo $tax_name; ?>" type="text" id="new-tag-<?php echo $tax_name; ?>" name="newtag[<?php echo $tax_name; ?>]" class="newtag form-input-tip" size="16" autocomplete="off" aria-describedby="new-tag-<?php echo $tax_name; ?>-desc" value="" /> 492 <input type="button" class="button tagadd" value="<?php esc_attr_e( 'Add'); ?>" /></p>515 <input type="button" class="button tagadd" value="<?php esc_attr_e( 'Add' ); ?>" /></p> 493 516 </div> 494 517 <p class="howto" id="new-tag-<?php echo $tax_name; ?>-desc"><?php echo $taxonomy->labels->separate_items_with_commas; ?></p> 495 <?php elseif ( empty( $terms_to_edit ) ) : ?>518 <?php elseif ( empty( $terms_to_edit ) ) : ?> 496 519 <p><?php echo $taxonomy->labels->no_terms; ?></p> 497 520 <?php endif; ?> … … 533 556 $args = $box['args']; 534 557 } 535 $r = wp_parse_args( $args, $defaults );558 $r = wp_parse_args( $args, $defaults ); 536 559 $tax_name = esc_attr( $r['taxonomy'] ); 537 560 $taxonomy = get_taxonomy( $r['taxonomy'] ); … … 555 578 ?> 556 579 <ul id="<?php echo $tax_name; ?>checklist" data-wp-lists="list:<?php echo $tax_name; ?>" class="categorychecklist form-no-clear"> 557 <?php wp_terms_checklist( $post->ID, array( 'taxonomy' => $tax_name, 'popular_cats' => $popular_ids ) ); ?> 580 <?php 581 wp_terms_checklist( 582 $post->ID, array( 583 'taxonomy' => $tax_name, 584 'popular_cats' => $popular_ids, 585 ) 586 ); 587 ?> 558 588 </ul> 559 589 </div> … … 627 657 * @param object $post 628 658 */ 629 function post_excerpt_meta_box($post) { 630 ?> 631 <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> 632 <p><?php 659 function post_excerpt_meta_box( $post ) { 660 ?> 661 <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> 662 <p> 663 <?php 633 664 printf( 634 665 /* translators: %s: Codex URL */ … … 636 667 __( 'https://codex.wordpress.org/Excerpt' ) 637 668 ); 638 ?></p> 669 ?> 670 </p> 639 671 <?php 640 672 } … … 647 679 * @param object $post 648 680 */ 649 function post_trackback_meta_box( $post) {681 function post_trackback_meta_box( $post ) { 650 682 $form_trackback = '<input type="text" name="trackback_url" id="trackback_url" class="code" value="' . 651 683 esc_attr( str_replace( "\n", ' ', $post->to_ping ) ) . '" aria-describedby="trackback-url-desc" />'; 652 if ( '' != $post->pinged) {653 $pings = '<p>'. __('Already pinged:') . '</p><ul>';654 $already_pinged = explode( "\n", trim($post->pinged));655 foreach ( $already_pinged as $pinged_url) {656 $pings .= "\n\t<li>" . esc_html( $pinged_url) . "</li>";684 if ( '' != $post->pinged ) { 685 $pings = '<p>' . __( 'Already pinged:' ) . '</p><ul>'; 686 $already_pinged = explode( "\n", trim( $post->pinged ) ); 687 foreach ( $already_pinged as $pinged_url ) { 688 $pings .= "\n\t<li>" . esc_html( $pinged_url ) . '</li>'; 657 689 } 658 690 $pings .= '</ul>'; … … 665 697 </p> 666 698 <p id="trackback-url-desc" class="howto"><?php _e( 'Separate multiple URLs with spaces' ); ?></p> 667 <p><?php 699 <p> 700 <?php 668 701 printf( 669 702 /* translators: %s: Codex URL */ … … 671 704 __( 'https://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments' ) 672 705 ); 673 ?></p> 674 <?php 675 if ( ! empty($pings) ) 706 ?> 707 </p> 708 <?php 709 if ( ! empty( $pings ) ) { 676 710 echo $pings; 677 711 } 712 } 678 713 679 714 /** … … 684 719 * @param object $post 685 720 */ 686 function post_custom_meta_box( $post) {721 function post_custom_meta_box( $post ) { 687 722 ?> 688 723 <div id="postcustomstuff"> 689 724 <div id="ajax-response"></div> 690 725 <?php 691 $metadata = has_meta( $post->ID);726 $metadata = has_meta( $post->ID ); 692 727 foreach ( $metadata as $key => $value ) { 693 if ( is_protected_meta( $metadata[ $key ][ 'meta_key' ], 'post' ) || ! current_user_can( 'edit_post_meta', $post->ID, $metadata[ $key ][ 'meta_key' ] ) )728 if ( is_protected_meta( $metadata[ $key ]['meta_key'], 'post' ) || ! current_user_can( 'edit_post_meta', $post->ID, $metadata[ $key ]['meta_key'] ) ) { 694 729 unset( $metadata[ $key ] ); 730 } 695 731 } 696 732 list_meta( $metadata ); 697 meta_form( $post ); ?> 698 </div> 699 <p><?php 733 meta_form( $post ); 734 ?> 735 </div> 736 <p> 737 <?php 700 738 printf( 701 739 /* translators: %s: Codex URL */ … … 703 741 __( 'https://codex.wordpress.org/Using_Custom_Fields' ) 704 742 ); 705 ?></p> 743 ?> 744 </p> 706 745 <?php 707 746 } … … 714 753 * @param object $post 715 754 */ 716 function post_comment_status_meta_box( $post) {755 function post_comment_status_meta_box( $post ) { 717 756 ?> 718 757 <input name="advanced_view" type="hidden" value="1" /> 719 758 <p class="meta-options"> 720 <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 /> 721 <label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked($post->ping_status, 'open'); ?> /> <?php 722 printf( 723 /* translators: %s: Codex URL */ 724 __( 'Allow <a href="%s">trackbacks and pingbacks</a> on this page' ), 725 __( 'https://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments' ) ); 726 ?></label> 759 <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 /> 760 <label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked( $post->ping_status, 'open' ); ?> /> 761 <?php 762 printf( 763 /* translators: %s: Codex URL */ 764 __( 'Allow <a href="%s">trackbacks and pingbacks</a> on this page' ), 765 __( 'https://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments' ) 766 ); 767 ?> 768 </label> 727 769 <?php 728 770 /** … … 747 789 * @return array 748 790 */ 749 function post_comment_meta_box_thead( $result) {750 unset( $result['cb'], $result['response']);791 function post_comment_meta_box_thead( $result ) { 792 unset( $result['cb'], $result['response'] ); 751 793 return $result; 752 794 } … … 762 804 wp_nonce_field( 'get-comments', 'add_comment_nonce', false ); 763 805 ?> 764 <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>806 <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> 765 807 <?php 766 808 767 $total = get_comments( array( 'post_id' => $post->ID, 'number' => 1, 'count' => true ) ); 768 $wp_list_table = _get_list_table('WP_Post_Comments_List_Table'); 809 $total = get_comments( 810 array( 811 'post_id' => $post->ID, 812 'number' => 1, 813 'count' => true, 814 ) 815 ); 816 $wp_list_table = _get_list_table( 'WP_Post_Comments_List_Table' ); 769 817 $wp_list_table->display( true ); 770 818 771 819 if ( 1 > $total ) { 772 echo '<p id="no-comments">' . __( 'No comments yet.') . '</p>';820 echo '<p id="no-comments">' . __( 'No comments yet.' ) . '</p>'; 773 821 } else { 774 822 $hidden = get_hidden_meta_boxes( get_current_screen() ); 775 if ( ! in_array( 'commentsdiv', $hidden) ) {823 if ( ! in_array( 'commentsdiv', $hidden ) ) { 776 824 ?> 777 825 <script type="text/javascript">jQuery(document).ready(function(){commentsBox.get(<?php echo $total; ?>, 10);});</script> … … 780 828 781 829 ?> 782 <p class="hide-if-no-js" id="show-comments"><a href="#commentstatusdiv" onclick="commentsBox.load(<?php echo $total; ?>);return false;"><?php _e( 'Show comments'); ?></a> <span class="spinner"></span></p>830 <p class="hide-if-no-js" id="show-comments"><a href="#commentstatusdiv" onclick="commentsBox.load(<?php echo $total; ?>);return false;"><?php _e( 'Show comments' ); ?></a> <span class="spinner"></span></p> 783 831 <?php 784 832 } … … 794 842 * @param object $post 795 843 */ 796 function post_slug_meta_box( $post) {797 /** This filter is documented in wp-admin/edit-tag-form.php */798 $editable_slug = apply_filters( 'editable_slug', $post->post_name, $post );799 ?> 800 <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 ); ?>" />844 function post_slug_meta_box( $post ) { 845 /** This filter is documented in wp-admin/edit-tag-form.php */ 846 $editable_slug = apply_filters( 'editable_slug', $post->post_name, $post ); 847 ?> 848 <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 ); ?>" /> 801 849 <?php 802 850 } … … 811 859 * @param object $post 812 860 */ 813 function post_author_meta_box( $post) {861 function post_author_meta_box( $post ) { 814 862 global $user_ID; 815 863 ?> 816 <label class="screen-reader-text" for="post_author_override"><?php _e('Author'); ?></label> 817 <?php 818 wp_dropdown_users( array( 819 'who' => 'authors', 820 'name' => 'post_author_override', 821 'selected' => empty($post->ID) ? $user_ID : $post->post_author, 822 'include_selected' => true, 823 'show' => 'display_name_with_login', 824 ) ); 864 <label class="screen-reader-text" for="post_author_override"><?php _e( 'Author' ); ?></label> 865 <?php 866 wp_dropdown_users( 867 array( 868 'who' => 'authors', 869 'name' => 'post_author_override', 870 'selected' => empty( $post->ID ) ? $user_ID : $post->post_author, 871 'include_selected' => true, 872 'show' => 'display_name_with_login', 873 ) 874 ); 825 875 } 826 876 … … 845 895 * @param object $post 846 896 */ 847 function page_attributes_meta_box( $post) {897 function page_attributes_meta_box( $post ) { 848 898 if ( is_post_type_hierarchical( $post->post_type ) ) : 849 899 $dropdown_args = array( … … 852 902 'selected' => $post->post_parent, 853 903 'name' => 'parent_id', 854 'show_option_none' => __( '(no parent)'),904 'show_option_none' => __( '(no parent)' ), 855 905 'sort_column' => 'menu_order, post_title', 856 906 'echo' => 0, … … 868 918 */ 869 919 $dropdown_args = apply_filters( 'page_attributes_dropdown_pages_args', $dropdown_args, $post ); 870 $pages = wp_dropdown_pages( $dropdown_args );871 if ( ! empty( $pages) ) :920 $pages = wp_dropdown_pages( $dropdown_args ); 921 if ( ! empty( $pages ) ) : 872 922 ?> 873 923 <p class="post-attributes-label-wrapper"><label class="post-attributes-label" for="parent_id"><?php _e( 'Parent' ); ?></label></p> … … 880 930 $template = ! empty( $post->page_template ) ? $post->page_template : false; 881 931 ?> 882 <p class="post-attributes-label-wrapper"><label class="post-attributes-label" for="page_template"><?php _e( 'Template' ); ?></label><?php 883 /** 884 * Fires immediately after the label inside the 'Template' section 885 * of the 'Page Attributes' meta box. 886 * 887 * @since 4.4.0 888 * 889 * @param string $template The template used for the current post. 890 * @param WP_Post $post The current post. 891 */ 892 do_action( 'page_attributes_meta_box_template', $template, $post ); 893 ?></p> 932 <p class="post-attributes-label-wrapper"><label class="post-attributes-label" for="page_template"><?php _e( 'Template' ); ?></label> 933 <?php 934 /** 935 * Fires immediately after the label inside the 'Template' section 936 * of the 'Page Attributes' meta box. 937 * 938 * @since 4.4.0 939 * 940 * @param string $template The template used for the current post. 941 * @param WP_Post $post The current post. 942 */ 943 do_action( 'page_attributes_meta_box_template', $template, $post ); 944 ?> 945 </p> 894 946 <select name="page_template" id="page_template"> 895 947 <?php … … 903 955 * include 'meta-box' or 'quick-edit'. 904 956 */ 905 $default_title = apply_filters( 'default_page_template_title', 957 $default_title = apply_filters( 'default_page_template_title', __( 'Default Template' ), 'meta-box' ); 906 958 ?> 907 959 <option value="default"><?php echo esc_html( $default_title ); ?></option> … … 924 976 <?php if ( 'page' == $post->post_type && get_current_screen()->get_help_tabs() ) : ?> 925 977 <p><?php _e( 'Need help? Use the Help tab above the screen title.' ); ?></p> 926 <?php endif; 978 <?php 979 endif; 927 980 endif; 928 981 } … … 937 990 * @param object $link 938 991 */ 939 function link_submit_meta_box( $link) {992 function link_submit_meta_box( $link ) { 940 993 ?> 941 994 <div class="submitbox" id="submitlink"> … … 950 1003 <div id="minor-publishing-actions"> 951 1004 <div id="preview-action"> 952 <?php if ( ! empty($link->link_id) ) { ?>953 <a class="preview button" href="<?php echo $link->link_url; ?>" target="_blank"><?php _e( 'Visit Link'); ?></a>1005 <?php if ( ! empty( $link->link_id ) ) { ?> 1006 <a class="preview button" href="<?php echo $link->link_url; ?>" target="_blank"><?php _e( 'Visit Link' ); ?></a> 954 1007 <?php } ?> 955 1008 </div> … … 959 1012 <div id="misc-publishing-actions"> 960 1013 <div class="misc-pub-section misc-pub-private"> 961 <label for="link_private" class="selectit"><input id="link_private" name="link_visible" type="checkbox" value="N" <?php checked( $link->link_visible, 'N'); ?> /> <?php _e('Keep this link private')?></label>1014 <label for="link_private" class="selectit"><input id="link_private" name="link_visible" type="checkbox" value="N" <?php checked( $link->link_visible, 'N' ); ?> /> <?php _e( 'Keep this link private' ); ?></label> 962 1015 </div> 963 1016 </div> … … 972 1025 <div id="delete-action"> 973 1026 <?php 974 if ( !empty($_GET['action']) && 'edit' == $_GET['action'] && current_user_can('manage_links') ) { ?> 975 <a class="submitdelete deletion" href="<?php echo wp_nonce_url("link.php?action=delete&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> 1027 if ( ! empty( $_GET['action'] ) && 'edit' == $_GET['action'] && current_user_can( 'manage_links' ) ) { 1028 ?> 1029 <a class="submitdelete deletion" href="<?php echo wp_nonce_url( "link.php?action=delete&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> 976 1030 <?php } ?> 977 1031 </div> 978 1032 979 1033 <div id="publishing-action"> 980 <?php if ( ! empty($link->link_id) ) { ?>981 <input name="save" type="submit" class="button button-primary button-large" id="publish" value="<?php esc_attr_e( 'Update Link' ) ?>" />1034 <?php if ( ! empty( $link->link_id ) ) { ?> 1035 <input name="save" type="submit" class="button button-primary button-large" id="publish" value="<?php esc_attr_e( 'Update Link' ); ?>" /> 982 1036 <?php } else { ?> 983 <input name="save" type="submit" class="button button-primary button-large" id="publish" value="<?php esc_attr_e( 'Add Link' ) ?>" />1037 <input name="save" type="submit" class="button button-primary button-large" id="publish" value="<?php esc_attr_e( 'Add Link' ); ?>" /> 984 1038 <?php } ?> 985 1039 </div> … … 1006 1060 * @param object $link 1007 1061 */ 1008 function link_categories_meta_box( $link) {1062 function link_categories_meta_box( $link ) { 1009 1063 ?> 1010 1064 <div id="taxonomy-linkcategory" class="categorydiv"> … … 1017 1071 <ul id="categorychecklist" data-wp-lists="list:category" class="categorychecklist form-no-clear"> 1018 1072 <?php 1019 if ( isset( $link->link_id) )1020 wp_link_category_checklist( $link->link_id);1021 else1073 if ( isset( $link->link_id ) ) { 1074 wp_link_category_checklist( $link->link_id ); 1075 } else { 1022 1076 wp_link_category_checklist(); 1077 } 1023 1078 ?> 1024 1079 </ul> … … 1027 1082 <div id="categories-pop" class="tabs-panel" style="display: none;"> 1028 1083 <ul id="categorychecklist-pop" class="categorychecklist form-no-clear"> 1029 <?php wp_popular_terms_checklist( 'link_category'); ?>1084 <?php wp_popular_terms_checklist( 'link_category' ); ?> 1030 1085 </ul> 1031 1086 </div> … … 1052 1107 * @param object $link 1053 1108 */ 1054 function link_target_meta_box($link) { ?> 1055 <fieldset><legend class="screen-reader-text"><span><?php _e('Target') ?></span></legend> 1109 function link_target_meta_box( $link ) { 1110 1111 ?> 1112 <fieldset><legend class="screen-reader-text"><span><?php _e( 'Target' ); ?></span></legend> 1056 1113 <p><label for="link_target_blank" class="selectit"> 1057 <input id="link_target_blank" type="radio" name="link_target" value="_blank" <?php echo ( isset( $link->link_target ) && ( $link->link_target == '_blank') ? 'checked="checked"' : ''); ?> />1058 <?php _e( '<code>_blank</code> — new window or tab.'); ?></label></p>1114 <input id="link_target_blank" type="radio" name="link_target" value="_blank" <?php echo ( isset( $link->link_target ) && ( $link->link_target == '_blank' ) ? 'checked="checked"' : '' ); ?> /> 1115 <?php _e( '<code>_blank</code> — new window or tab.' ); ?></label></p> 1059 1116 <p><label for="link_target_top" class="selectit"> 1060 <input id="link_target_top" type="radio" name="link_target" value="_top" <?php echo ( isset( $link->link_target ) && ( $link->link_target == '_top') ? 'checked="checked"' : ''); ?> />1061 <?php _e( '<code>_top</code> — current window or tab, with no frames.'); ?></label></p>1117 <input id="link_target_top" type="radio" name="link_target" value="_top" <?php echo ( isset( $link->link_target ) && ( $link->link_target == '_top' ) ? 'checked="checked"' : '' ); ?> /> 1118 <?php _e( '<code>_top</code> — current window or tab, with no frames.' ); ?></label></p> 1062 1119 <p><label for="link_target_none" class="selectit"> 1063 <input id="link_target_none" type="radio" name="link_target" value="" <?php echo ( isset( $link->link_target ) && ( $link->link_target == '') ? 'checked="checked"' : ''); ?> />1064 <?php _e( '<code>_none</code> — same window or tab.'); ?></label></p>1120 <input id="link_target_none" type="radio" name="link_target" value="" <?php echo ( isset( $link->link_target ) && ( $link->link_target == '' ) ? 'checked="checked"' : '' ); ?> /> 1121 <?php _e( '<code>_none</code> — same window or tab.' ); ?></label></p> 1065 1122 </fieldset> 1066 <p><?php _e( 'Choose the target frame for your link.'); ?></p>1123 <p><?php _e( 'Choose the target frame for your link.' ); ?></p> 1067 1124 <?php 1068 1125 } … … 1087 1144 1088 1145 $link_rel = isset( $link->link_rel ) ? $link->link_rel : ''; // In PHP 5.3: $link_rel = $link->link_rel ?: ''; 1089 $rels = preg_split('/\s+/', $link_rel);1090 1091 if ( '' != $value && in_array($value, $rels) ) {1146 $rels = preg_split( '/\s+/', $link_rel ); 1147 1148 if ( '' != $value && in_array( $value, $rels ) ) { 1092 1149 echo ' checked="checked"'; 1093 1150 } 1094 1151 1095 if ('' == $value) { 1096 if ('family' == $class && strpos($link_rel, 'child') === false && strpos($link_rel, 'parent') === false && strpos($link_rel, 'sibling') === false && strpos($link_rel, 'spouse') === false && strpos($link_rel, 'kin') === false) echo ' checked="checked"'; 1097 if ('friendship' == $class && strpos($link_rel, 'friend') === false && strpos($link_rel, 'acquaintance') === false && strpos($link_rel, 'contact') === false) echo ' checked="checked"'; 1098 if ('geographical' == $class && strpos($link_rel, 'co-resident') === false && strpos($link_rel, 'neighbor') === false) echo ' checked="checked"'; 1099 if ('identity' == $class && in_array('me', $rels) ) echo ' checked="checked"'; 1152 if ( '' == $value ) { 1153 if ( 'family' == $class && strpos( $link_rel, 'child' ) === false && strpos( $link_rel, 'parent' ) === false && strpos( $link_rel, 'sibling' ) === false && strpos( $link_rel, 'spouse' ) === false && strpos( $link_rel, 'kin' ) === false ) { 1154 echo ' checked="checked"'; 1155 } 1156 if ( 'friendship' == $class && strpos( $link_rel, 'friend' ) === false && strpos( $link_rel, 'acquaintance' ) === false && strpos( $link_rel, 'contact' ) === false ) { 1157 echo ' checked="checked"'; 1158 } 1159 if ( 'geographical' == $class && strpos( $link_rel, 'co-resident' ) === false && strpos( $link_rel, 'neighbor' ) === false ) { 1160 echo ' checked="checked"'; 1161 } 1162 if ( 'identity' == $class && in_array( 'me', $rels ) ) { 1163 echo ' checked="checked"'; 1164 } 1100 1165 } 1101 1166 } … … 1108 1173 * @param object $link 1109 1174 */ 1110 function link_xfn_meta_box( $link) {1175 function link_xfn_meta_box( $link ) { 1111 1176 ?> 1112 1177 <table class="links-table"> 1113 1178 <tr> 1114 <th scope="row"><label for="link_rel"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'rel:')?></label></th>1115 <td><input type="text" name="link_rel" id="link_rel" value="<?php echo ( isset( $link->link_rel ) ? esc_attr( $link->link_rel) : ''); ?>" /></td>1179 <th scope="row"><label for="link_rel"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'rel:' ); ?></label></th> 1180 <td><input type="text" name="link_rel" id="link_rel" value="<?php echo ( isset( $link->link_rel ) ? esc_attr( $link->link_rel ) : '' ); ?>" /></td> 1116 1181 </tr> 1117 1182 <tr> 1118 <th scope="row"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'identity')?></th>1119 <td><fieldset><legend class="screen-reader-text"><span><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'identity')?></span></legend>1183 <th scope="row"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'identity' ); ?></th> 1184 <td><fieldset><legend class="screen-reader-text"><span><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'identity' ); ?></span></legend> 1120 1185 <label for="me"> 1121 <input type="checkbox" name="identity" value="me" id="me" <?php xfn_check( 'identity', 'me'); ?> />1122 <?php _e( 'another web address of mine')?></label>1186 <input type="checkbox" name="identity" value="me" id="me" <?php xfn_check( 'identity', 'me' ); ?> /> 1187 <?php _e( 'another web address of mine' ); ?></label> 1123 1188 </fieldset></td> 1124 1189 </tr> 1125 1190 <tr> 1126 <th scope="row"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'friendship')?></th>1127 <td><fieldset><legend class="screen-reader-text"><span><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'friendship')?></span></legend>1191 <th scope="row"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'friendship' ); ?></th> 1192 <td><fieldset><legend class="screen-reader-text"><span><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'friendship' ); ?></span></legend> 1128 1193 <label for="contact"> 1129 <input class="valinp" type="radio" name="friendship" value="contact" id="contact" <?php xfn_check( 'friendship', 'contact'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('contact')?>1194 <input class="valinp" type="radio" name="friendship" value="contact" id="contact" <?php xfn_check( 'friendship', 'contact' ); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'contact' ); ?> 1130 1195 </label> 1131 1196 <label for="acquaintance"> 1132 <input class="valinp" type="radio" name="friendship" value="acquaintance" id="acquaintance" <?php xfn_check( 'friendship', 'acquaintance'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('acquaintance')?>1197 <input class="valinp" type="radio" name="friendship" value="acquaintance" id="acquaintance" <?php xfn_check( 'friendship', 'acquaintance' ); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'acquaintance' ); ?> 1133 1198 </label> 1134 1199 <label for="friend"> 1135 <input class="valinp" type="radio" name="friendship" value="friend" id="friend" <?php xfn_check( 'friendship', 'friend'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('friend')?>1200 <input class="valinp" type="radio" name="friendship" value="friend" id="friend" <?php xfn_check( 'friendship', 'friend' ); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'friend' ); ?> 1136 1201 </label> 1137 1202 <label for="friendship"> 1138 <input name="friendship" type="radio" class="valinp" value="" id="friendship" <?php xfn_check( 'friendship'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('none')?>1203 <input name="friendship" type="radio" class="valinp" value="" id="friendship" <?php xfn_check( 'friendship' ); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'none' ); ?> 1139 1204 </label> 1140 1205 </fieldset></td> 1141 1206 </tr> 1142 1207 <tr> 1143 <th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'physical')?> </th>1144 <td><fieldset><legend class="screen-reader-text"><span><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'physical')?></span></legend>1208 <th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'physical' ); ?> </th> 1209 <td><fieldset><legend class="screen-reader-text"><span><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'physical' ); ?></span></legend> 1145 1210 <label for="met"> 1146 <input class="valinp" type="checkbox" name="physical" value="met" id="met" <?php xfn_check( 'physical', 'met'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('met')?>1211 <input class="valinp" type="checkbox" name="physical" value="met" id="met" <?php xfn_check( 'physical', 'met' ); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'met' ); ?> 1147 1212 </label> 1148 1213 </fieldset></td> 1149 1214 </tr> 1150 1215 <tr> 1151 <th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'professional')?> </th>1152 <td><fieldset><legend class="screen-reader-text"><span><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'professional')?></span></legend>1216 <th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'professional' ); ?> </th> 1217 <td><fieldset><legend class="screen-reader-text"><span><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'professional' ); ?></span></legend> 1153 1218 <label for="co-worker"> 1154 <input class="valinp" type="checkbox" name="professional" value="co-worker" id="co-worker" <?php xfn_check( 'professional', 'co-worker'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('co-worker')?>1219 <input class="valinp" type="checkbox" name="professional" value="co-worker" id="co-worker" <?php xfn_check( 'professional', 'co-worker' ); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'co-worker' ); ?> 1155 1220 </label> 1156 1221 <label for="colleague"> 1157 <input class="valinp" type="checkbox" name="professional" value="colleague" id="colleague" <?php xfn_check( 'professional', 'colleague'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('colleague')?>1222 <input class="valinp" type="checkbox" name="professional" value="colleague" id="colleague" <?php xfn_check( 'professional', 'colleague' ); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'colleague' ); ?> 1158 1223 </label> 1159 1224 </fieldset></td> 1160 1225 </tr> 1161 1226 <tr> 1162 <th scope="row"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'geographical')?></th>1163 <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'geographical')?> </span></legend>1227 <th scope="row"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'geographical' ); ?></th> 1228 <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'geographical' ); ?> </span></legend> 1164 1229 <label for="co-resident"> 1165 <input class="valinp" type="radio" name="geographical" value="co-resident" id="co-resident" <?php xfn_check( 'geographical', 'co-resident'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('co-resident')?>1230 <input class="valinp" type="radio" name="geographical" value="co-resident" id="co-resident" <?php xfn_check( 'geographical', 'co-resident' ); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'co-resident' ); ?> 1166 1231 </label> 1167 1232 <label for="neighbor"> 1168 <input class="valinp" type="radio" name="geographical" value="neighbor" id="neighbor" <?php xfn_check( 'geographical', 'neighbor'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('neighbor')?>1233 <input class="valinp" type="radio" name="geographical" value="neighbor" id="neighbor" <?php xfn_check( 'geographical', 'neighbor' ); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'neighbor' ); ?> 1169 1234 </label> 1170 1235 <label for="geographical"> 1171 <input class="valinp" type="radio" name="geographical" value="" id="geographical" <?php xfn_check( 'geographical'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('none')?>1236 <input class="valinp" type="radio" name="geographical" value="" id="geographical" <?php xfn_check( 'geographical' ); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'none' ); ?> 1172 1237 </label> 1173 1238 </fieldset></td> 1174 1239 </tr> 1175 1240 <tr> 1176 <th scope="row"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'family')?></th>1177 <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'family')?> </span></legend>1241 <th scope="row"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'family' ); ?></th> 1242 <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'family' ); ?> </span></legend> 1178 1243 <label for="child"> 1179 <input class="valinp" type="radio" name="family" value="child" id="child" <?php xfn_check( 'family', 'child'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('child')?>1244 <input class="valinp" type="radio" name="family" value="child" id="child" <?php xfn_check( 'family', 'child' ); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'child' ); ?> 1180 1245 </label> 1181 1246 <label for="kin"> 1182 <input class="valinp" type="radio" name="family" value="kin" id="kin" <?php xfn_check( 'family', 'kin'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('kin')?>1247 <input class="valinp" type="radio" name="family" value="kin" id="kin" <?php xfn_check( 'family', 'kin' ); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'kin' ); ?> 1183 1248 </label> 1184 1249 <label for="parent"> 1185 <input class="valinp" type="radio" name="family" value="parent" id="parent" <?php xfn_check( 'family', 'parent'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('parent')?>1250 <input class="valinp" type="radio" name="family" value="parent" id="parent" <?php xfn_check( 'family', 'parent' ); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'parent' ); ?> 1186 1251 </label> 1187 1252 <label for="sibling"> 1188 <input class="valinp" type="radio" name="family" value="sibling" id="sibling" <?php xfn_check( 'family', 'sibling'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('sibling')?>1253 <input class="valinp" type="radio" name="family" value="sibling" id="sibling" <?php xfn_check( 'family', 'sibling' ); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'sibling' ); ?> 1189 1254 </label> 1190 1255 <label for="spouse"> 1191 <input class="valinp" type="radio" name="family" value="spouse" id="spouse" <?php xfn_check( 'family', 'spouse'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('spouse')?>1256 <input class="valinp" type="radio" name="family" value="spouse" id="spouse" <?php xfn_check( 'family', 'spouse' ); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'spouse' ); ?> 1192 1257 </label> 1193 1258 <label for="family"> 1194 <input class="valinp" type="radio" name="family" value="" id="family" <?php xfn_check( 'family'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('none')?>1259 <input class="valinp" type="radio" name="family" value="" id="family" <?php xfn_check( 'family' ); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'none' ); ?> 1195 1260 </label> 1196 1261 </fieldset></td> 1197 1262 </tr> 1198 1263 <tr> 1199 <th scope="row"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'romantic')?></th>1200 <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'romantic')?> </span></legend>1264 <th scope="row"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'romantic' ); ?></th> 1265 <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'romantic' ); ?> </span></legend> 1201 1266 <label for="muse"> 1202 <input class="valinp" type="checkbox" name="romantic" value="muse" id="muse" <?php xfn_check( 'romantic', 'muse'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('muse')?>1267 <input class="valinp" type="checkbox" name="romantic" value="muse" id="muse" <?php xfn_check( 'romantic', 'muse' ); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'muse' ); ?> 1203 1268 </label> 1204 1269 <label for="crush"> 1205 <input class="valinp" type="checkbox" name="romantic" value="crush" id="crush" <?php xfn_check( 'romantic', 'crush'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('crush')?>1270 <input class="valinp" type="checkbox" name="romantic" value="crush" id="crush" <?php xfn_check( 'romantic', 'crush' ); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'crush' ); ?> 1206 1271 </label> 1207 1272 <label for="date"> 1208 <input class="valinp" type="checkbox" name="romantic" value="date" id="date" <?php xfn_check( 'romantic', 'date'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('date')?>1273 <input class="valinp" type="checkbox" name="romantic" value="date" id="date" <?php xfn_check( 'romantic', 'date' ); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'date' ); ?> 1209 1274 </label> 1210 1275 <label for="romantic"> 1211 <input class="valinp" type="checkbox" name="romantic" value="sweetheart" id="romantic" <?php xfn_check( 'romantic', 'sweetheart'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('sweetheart')?>1276 <input class="valinp" type="checkbox" name="romantic" value="sweetheart" id="romantic" <?php xfn_check( 'romantic', 'sweetheart' ); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'sweetheart' ); ?> 1212 1277 </label> 1213 1278 </fieldset></td> … … 1215 1280 1216 1281 </table> 1217 <p><?php _e( 'If the link is to a person, you can specify your relationship with them using the above form. If you would like to learn more about the idea check out <a href="http://gmpg.org/xfn/">XFN</a>.'); ?></p>1282 <p><?php _e( 'If the link is to a person, you can specify your relationship with them using the above form. If you would like to learn more about the idea check out <a href="http://gmpg.org/xfn/">XFN</a>.' ); ?></p> 1218 1283 <?php 1219 1284 } … … 1226 1291 * @param object $link 1227 1292 */ 1228 function link_advanced_meta_box( $link) {1293 function link_advanced_meta_box( $link ) { 1229 1294 ?> 1230 1295 <table class="links-table" cellpadding="0"> 1231 1296 <tr> 1232 <th scope="row"><label for="link_image"><?php _e( 'Image Address')?></label></th>1233 <td><input type="text" name="link_image" class="code" id="link_image" maxlength="255" value="<?php echo ( isset( $link->link_image ) ? esc_attr( $link->link_image) : ''); ?>" /></td>1297 <th scope="row"><label for="link_image"><?php _e( 'Image Address' ); ?></label></th> 1298 <td><input type="text" name="link_image" class="code" id="link_image" maxlength="255" value="<?php echo ( isset( $link->link_image ) ? esc_attr( $link->link_image ) : '' ); ?>" /></td> 1234 1299 </tr> 1235 1300 <tr> 1236 <th scope="row"><label for="rss_uri"><?php _e( 'RSS Address')?></label></th>1237 <td><input name="link_rss" class="code" type="text" id="rss_uri" maxlength="255" value="<?php echo ( isset( $link->link_rss ) ? esc_attr( $link->link_rss) : ''); ?>" /></td>1301 <th scope="row"><label for="rss_uri"><?php _e( 'RSS Address' ); ?></label></th> 1302 <td><input name="link_rss" class="code" type="text" id="rss_uri" maxlength="255" value="<?php echo ( isset( $link->link_rss ) ? esc_attr( $link->link_rss ) : '' ); ?>" /></td> 1238 1303 </tr> 1239 1304 <tr> 1240 <th scope="row"><label for="link_notes"><?php _e( 'Notes')?></label></th>1241 <td><textarea name="link_notes" id="link_notes" rows="10"><?php echo ( isset( $link->link_notes ) ? $link->link_notes : '' ); // textarea_escaped ?></textarea></td>1305 <th scope="row"><label for="link_notes"><?php _e( 'Notes' ); ?></label></th> 1306 <td><textarea name="link_notes" id="link_notes" rows="10"><?php echo ( isset( $link->link_notes ) ? $link->link_notes : '' ); // textarea_escaped ?></textarea></td> 1242 1307 </tr> 1243 1308 <tr> 1244 <th scope="row"><label for="link_rating"><?php _e( 'Rating')?></label></th>1309 <th scope="row"><label for="link_rating"><?php _e( 'Rating' ); ?></label></th> 1245 1310 <td><select name="link_rating" id="link_rating" size="1"> 1246 1311 <?php 1247 for ( $r = 0; $r <= 10; $r++ ) { 1248 echo '<option value="' . $r . '"'; 1249 if ( isset($link->link_rating) && $link->link_rating == $r ) 1250 echo ' selected="selected"'; 1251 echo('>' . $r . '</option>'); 1312 for ( $r = 0; $r <= 10; $r++ ) { 1313 echo '<option value="' . $r . '"'; 1314 if ( isset( $link->link_rating ) && $link->link_rating == $r ) { 1315 echo ' selected="selected"'; 1252 1316 } 1253 ?></select> <?php _e('(Leave at 0 for no rating.)') ?> 1317 echo( '>' . $r . '</option>' ); 1318 } 1319 ?> 1320 </select> <?php _e( '(Leave at 0 for no rating.)' ); ?> 1254 1321 </td> 1255 1322 </tr> … … 1283 1350 } 1284 1351 1285 foreach ( wp_get_attachment_id3_keys( $post, 'edit' ) as $key => $label ) : ?> 1352 foreach ( wp_get_attachment_id3_keys( $post, 'edit' ) as $key => $label ) : 1353 ?> 1286 1354 <p> 1287 <label for="title"><?php echo $label ?></label><br /> 1288 <input type="text" name="id3_<?php echo esc_attr( $key ) ?>" id="id3_<?php echo esc_attr( $key ) ?>" class="large-text" value="<?php 1289 if ( ! empty( $meta[ $key ] ) ) { 1290 echo esc_attr( $meta[ $key ] ); 1291 } 1292 ?>" /> 1355 <label for="title"><?php echo $label; ?></label><br /> 1356 <input type="text" name="id3_<?php echo esc_attr( $key ); ?>" id="id3_<?php echo esc_attr( $key ); ?>" class="large-text" value=" 1357 <?php 1358 if ( ! empty( $meta[ $key ] ) ) { 1359 echo esc_attr( $meta[ $key ] ); 1360 } 1361 ?> 1362 " /> 1293 1363 </p> 1294 1364 <?php
Note: See TracChangeset
for help on using the changeset viewer.