diff --git a/src/wp-admin/includes/media.php b/src/wp-admin/includes/media.php
index 0eeeaea..ab8fa65 100644
a
|
b
|
function edit_form_image_editor( $post ) { |
2686 | 2686 | endif; ?> |
2687 | 2687 | </div> |
2688 | 2688 | <div class="wp_attachment_details edit-form-section"> |
| 2689 | <?php if ( post_type_supports('attachment', 'caption') ) { ?> |
2689 | 2690 | <p> |
2690 | 2691 | <label for="attachment_caption"><strong><?php _e( 'Caption' ); ?></strong></label><br /> |
2691 | 2692 | <textarea class="widefat" name="excerpt" id="attachment_caption"><?php echo $post->post_excerpt; ?></textarea> |
2692 | 2693 | </p> |
2693 | | |
2694 | | |
| 2694 | <?php } ?> |
2695 | 2695 | <?php if ( 'image' === substr( $post->post_mime_type, 0, 5 ) ) : ?> |
2696 | 2696 | <p> |
| 2697 | <?php if ( post_type_supports('attachment', 'alt') ) { ?> |
2697 | 2698 | <label for="attachment_alt"><strong><?php _e( 'Alternative Text' ); ?></strong></label><br /> |
2698 | 2699 | <input type="text" class="widefat" name="_wp_attachment_image_alt" id="attachment_alt" value="<?php echo esc_attr( $alt_text ); ?>" /> |
2699 | 2700 | </p> |
| 2701 | <?php } ?> |
2700 | 2702 | <?php endif; ?> |
2701 | 2703 | |
2702 | 2704 | <?php |
… |
… |
function edit_form_image_editor( $post ) { |
2709 | 2711 | 'quicktags' => $quicktags_settings, |
2710 | 2712 | ); |
2711 | 2713 | ?> |
2712 | | |
| 2714 | <?php if ( post_type_supports('attachment', 'description') ) { ?> |
2713 | 2715 | <label for="content"><strong><?php _e( 'Description' ); ?></strong><?php |
2714 | 2716 | if ( preg_match( '#^(audio|video)/#', $post->post_mime_type ) ) { |
2715 | 2717 | echo ': ' . __( 'Displayed on attachment pages.' ); |
2716 | 2718 | } ?></label> |
2717 | 2719 | <?php wp_editor( $post->post_content, 'attachment_content', $editor_args ); ?> |
2718 | | |
| 2720 | <?php } ?> |
2719 | 2721 | </div> |
2720 | 2722 | <?php |
2721 | 2723 | $extras = get_compat_media_markup( $post->ID ); |
diff --git a/src/wp-includes/media-template.php b/src/wp-includes/media-template.php
index 1c7749a..366c601 100644
a
|
b
|
function wp_print_media_templates() { |
361 | 361 | <input type="text" value="{{ data.url }}" readonly /> |
362 | 362 | </label> |
363 | 363 | <# var maybeReadOnly = data.can.save || data.allowLocalEdits ? '' : 'readonly'; #> |
| 364 | <?php if ( post_type_supports('attachment', 'title') ) { ?> |
364 | 365 | <label class="setting" data-setting="title"> |
365 | 366 | <span class="name"><?php _e('Title'); ?></span> |
366 | 367 | <input type="text" value="{{ data.title }}" {{ maybeReadOnly }} /> |
367 | 368 | </label> |
| 369 | <?php } ?> |
368 | 370 | <# if ( 'audio' === data.type ) { #> |
369 | 371 | <?php foreach ( array( |
370 | 372 | 'artist' => __( 'Artist' ), |
… |
… |
function wp_print_media_templates() { |
376 | 378 | </label> |
377 | 379 | <?php endforeach; ?> |
378 | 380 | <# } #> |
| 381 | <?php if ( post_type_supports( 'attachment', 'caption') ) { ?> |
379 | 382 | <label class="setting" data-setting="caption"> |
380 | 383 | <span class="name"><?php _e( 'Caption' ); ?></span> |
381 | 384 | <textarea {{ maybeReadOnly }}>{{ data.caption }}</textarea> |
382 | 385 | </label> |
| 386 | <?php } ?> |
383 | 387 | <# if ( 'image' === data.type ) { #> |
| 388 | <?php if ( post_type_supports('attachment', 'alt') ) { ?> |
384 | 389 | <label class="setting" data-setting="alt"> |
385 | 390 | <span class="name"><?php _e( 'Alt Text' ); ?></span> |
386 | 391 | <input type="text" value="{{ data.alt }}" {{ maybeReadOnly }} /> |
387 | 392 | </label> |
| 393 | <?php } ?> |
388 | 394 | <# } #> |
| 395 | <?php if ( post_type_supports('attachment', 'description') ) { ?> |
389 | 396 | <label class="setting" data-setting="description"> |
390 | 397 | <span class="name"><?php _e('Description'); ?></span> |
391 | 398 | <textarea {{ maybeReadOnly }}>{{ data.description }}</textarea> |
392 | 399 | </label> |
| 400 | <?php } ?> |
393 | 401 | <label class="setting"> |
394 | 402 | <span class="name"><?php _e( 'Uploaded By' ); ?></span> |
395 | 403 | <span class="value">{{ data.authorName }}</span> |
… |
… |
function wp_print_media_templates() { |
540 | 548 | <input type="text" value="{{ data.url }}" readonly /> |
541 | 549 | </label> |
542 | 550 | <# var maybeReadOnly = data.can.save || data.allowLocalEdits ? '' : 'readonly'; #> |
| 551 | <?php if ( post_type_supports('attachment', 'title') ) { ?> |
543 | 552 | <label class="setting" data-setting="title"> |
544 | 553 | <span class="name"><?php _e('Title'); ?></span> |
545 | 554 | <input type="text" value="{{ data.title }}" {{ maybeReadOnly }} /> |
546 | 555 | </label> |
| 556 | <?php } ?> |
547 | 557 | <# if ( 'audio' === data.type ) { #> |
548 | 558 | <?php foreach ( array( |
549 | 559 | 'artist' => __( 'Artist' ), |
… |
… |
function wp_print_media_templates() { |
555 | 565 | </label> |
556 | 566 | <?php endforeach; ?> |
557 | 567 | <# } #> |
| 568 | <?php if ( post_type_supports('attachment', 'caption') ) { ?> |
558 | 569 | <label class="setting" data-setting="caption"> |
559 | 570 | <span class="name"><?php _e('Caption'); ?></span> |
560 | 571 | <textarea {{ maybeReadOnly }}>{{ data.caption }}</textarea> |
561 | 572 | </label> |
| 573 | <?php } ?> |
562 | 574 | <# if ( 'image' === data.type ) { #> |
| 575 | <?php if ( post_type_supports('attachment', 'alt') ) { ?> |
563 | 576 | <label class="setting" data-setting="alt"> |
564 | 577 | <span class="name"><?php _e('Alt Text'); ?></span> |
565 | 578 | <input type="text" value="{{ data.alt }}" {{ maybeReadOnly }} /> |
566 | 579 | </label> |
| 580 | <?php } ?> |
567 | 581 | <# } #> |
| 582 | <?php if ( post_type_supports('attachment', 'description') ) { ?> |
568 | 583 | <label class="setting" data-setting="description"> |
569 | 584 | <span class="name"><?php _e('Description'); ?></span> |
570 | 585 | <textarea {{ maybeReadOnly }}>{{ data.description }}</textarea> |
571 | 586 | </label> |
| 587 | <?php } ?> |
572 | 588 | </script> |
573 | 589 | |
574 | 590 | <script type="text/html" id="tmpl-media-selection"> |
… |
… |
function wp_print_media_templates() { |
878 | 894 | <?php |
879 | 895 | /** This filter is documented in wp-admin/includes/media.php */ |
880 | 896 | if ( ! apply_filters( 'disable_captions', '' ) ) : ?> |
| 897 | <?php if ( post_type_supports('attachment', 'caption') ) { ?> |
881 | 898 | <label class="setting caption"> |
882 | 899 | <span><?php _e('Caption'); ?></span> |
883 | 900 | <textarea data-setting="caption">{{ data.model.caption }}</textarea> |
884 | 901 | </label> |
| 902 | <?php } ?> |
885 | 903 | <?php endif; ?> |
886 | | |
| 904 | <?php if ( post_type_supports('attachment', 'alt') ) { ?> |
887 | 905 | <label class="setting alt-text"> |
888 | 906 | <span><?php _e('Alternative Text'); ?></span> |
889 | 907 | <input type="text" data-setting="alt" value="{{ data.model.alt }}" /> |
890 | 908 | </label> |
891 | | |
| 909 | <?php } ?> |
892 | 910 | <h3><?php _e( 'Display Settings' ); ?></h3> |
893 | 911 | <div class="setting align"> |
894 | 912 | <span><?php _e('Align'); ?></span> |
diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php
index e9d9317..70149ac 100644
a
|
b
|
function create_initial_post_types() { |
72 | 72 | 'query_var' => false, |
73 | 73 | 'show_in_nav_menus' => false, |
74 | 74 | 'delete_with_user' => true, |
75 | | 'supports' => array( 'title', 'author', 'comments' ), |
| 75 | 'supports' => array( 'title', 'author', 'comments', 'caption', 'description', 'alt' ), |
76 | 76 | ) ); |
77 | 77 | add_post_type_support( 'attachment:audio', 'thumbnail' ); |
78 | 78 | add_post_type_support( 'attachment:video', 'thumbnail' ); |