Changeset 47084 for trunk/src/wp-admin/includes/media.php
- Timestamp:
- 01/18/2020 12:52:28 AM (6 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-admin/includes/media.php (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/media.php
r47039 r47084 16 16 function media_upload_tabs() { 17 17 $_default_tabs = array( 18 'type' => __( 'From Computer' ), // handler action suffix => tab text18 'type' => __( 'From Computer' ), // Handler action suffix => tab text. 19 19 'type_url' => __( 'From URL' ), 20 20 'gallery' => __( 'Gallery' ), … … 227 227 $caption = preg_replace_callback( '/<[a-zA-Z0-9]+(?: [^<>]+>)*/', '_cleanup_image_add_caption', $caption ); 228 228 229 // Convert any remaining line breaks to <br >.229 // Convert any remaining line breaks to <br />. 230 230 $caption = preg_replace( '/[ \n\t]*\n[ \t]*/', '<br />', $caption ); 231 231 … … 389 389 } 390 390 391 // Construct the attachment array 391 // Construct the attachment array. 392 392 $attachment = array_merge( 393 393 array( … … 405 405 unset( $attachment['ID'] ); 406 406 407 // Save the data 407 // Save the data. 408 408 $attachment_id = wp_insert_attachment( $attachment, $file, $post_id, true ); 409 409 … … 491 491 unset( $attachment['ID'] ); 492 492 493 // Save the attachment metadata 493 // Save the attachment metadata. 494 494 $attachment_id = wp_insert_attachment( $attachment, $file, $post_id, true ); 495 495 … … 520 520 521 521 wp_enqueue_style( 'colors' ); 522 // Check callback name for 'media' 522 // Check callback name for 'media'. 523 523 if ( 524 524 ( is_array( $content_func ) && ! empty( $content_func[1] ) && 0 === strpos( (string) $content_func[1], 'media' ) ) || … … 850 850 if ( isset( $_POST['html-upload'] ) && ! empty( $_FILES ) ) { 851 851 check_admin_referer( 'media-form' ); 852 // Upload File button was clicked 852 // Upload File button was clicked. 853 853 $id = media_handle_upload( 'async-upload', $_REQUEST['post_id'] ); 854 854 unset( $_FILES ); … … 1422 1422 } 1423 1423 1424 // Merge default fields with their errors, so any key passed with the error (e.g. 'error', 'helps', 'value') will replace the default 1425 // The recursive merge is easily traversed with array casting: foreach ( (array) $things as $thing ) 1424 /* 1425 * Merge default fields with their errors, so any key passed with the error 1426 * (e.g. 'error', 'helps', 'value') will replace the default. 1427 * The recursive merge is easily traversed with array casting: 1428 * foreach ( (array) $things as $thing ) 1429 */ 1426 1430 $form_fields = array_merge_recursive( $form_fields, (array) $errors ); 1427 1431 … … 1597 1601 } 1598 1602 1599 $display_title = ( ! empty( $title ) ) ? $title : $filename; // $title shouldn't ever be empty, but just in case 1603 $display_title = ( ! empty( $title ) ) ? $title : $filename; // $title shouldn't ever be empty, but just in case. 1600 1604 $display_title = $parsed_args['show_title'] ? "<div class='filename new'><span class='title'>" . wp_html_excerpt( $display_title, 60, '…' ) . '</span></div>' : ''; 1601 1605 … … 1711 1715 if ( isset( $_GET['post_id'] ) ) { 1712 1716 $calling_post_id = absint( $_GET['post_id'] ); 1713 } elseif ( isset( $_POST ) && count( $_POST ) ) {// Like for async-upload where $_GET['post_id'] isn't set 1717 } elseif ( isset( $_POST ) && count( $_POST ) ) {// Like for async-upload where $_GET['post_id'] isn't set. 1714 1718 $calling_post_id = $post->post_parent; 1715 1719 } … … 1876 1880 } 1877 1881 1878 // Merge default fields with their errors, so any key passed with the error (e.g. 'error', 'helps', 'value') will replace the default 1879 // The recursive merge is easily traversed with array casting: foreach ( (array) $things as $thing ) 1882 /* 1883 * Merge default fields with their errors, so any key passed with the error 1884 * (e.g. 'error', 'helps', 'value') will replace the default. 1885 * The recursive merge is easily traversed with array casting: 1886 * foreach ( (array) $things as $thing ) 1887 */ 1880 1888 $form_fields = array_merge_recursive( $form_fields, (array) $args['errors'] ); 1881 1889 … … 2133 2141 ); 2134 2142 2135 // Currently only iOS Safari supports multiple files uploading but iOS 7.x has a bug that prevents uploading of videos 2136 // when enabled. See #29602. 2143 /* 2144 * Currently only iOS Safari supports multiple files uploading, 2145 * but iOS 7.x has a bug that prevents uploading of videos when enabled. 2146 * See #29602. 2147 */ 2137 2148 if ( 2138 2149 wp_is_mobile() && … … 2701 2712 } 2702 2713 } 2703 // If available type specified by media button clicked, filter by that type 2714 // If available type specified by media button clicked, filter by that type. 2704 2715 if ( empty( $_GET['post_mime_type'] ) && ! empty( $num_posts[ $type ] ) ) { 2705 2716 $_GET['post_mime_type'] = $type;
Note: See TracChangeset
for help on using the changeset viewer.