Make WordPress Core


Ignore:
Timestamp:
01/18/2020 12:52:28 AM (6 years ago)
Author:
SergeyBiryukov
Message:

Docs: Improve comments in some wp-admin files per the documentation standards.

Props passoniate.
Fixes #49215, #49216.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/media.php

    r47039 r47084  
    1616function media_upload_tabs() {
    1717    $_default_tabs = array(
    18         'type'     => __( 'From Computer' ), // handler action suffix => tab text
     18        'type'     => __( 'From Computer' ), // Handler action suffix => tab text.
    1919        'type_url' => __( 'From URL' ),
    2020        'gallery'  => __( 'Gallery' ),
     
    227227    $caption = preg_replace_callback( '/<[a-zA-Z0-9]+(?: [^<>]+>)*/', '_cleanup_image_add_caption', $caption );
    228228
    229     // Convert any remaining line breaks to <br>.
     229    // Convert any remaining line breaks to <br />.
    230230    $caption = preg_replace( '/[ \n\t]*\n[ \t]*/', '<br />', $caption );
    231231
     
    389389    }
    390390
    391     // Construct the attachment array
     391    // Construct the attachment array.
    392392    $attachment = array_merge(
    393393        array(
     
    405405    unset( $attachment['ID'] );
    406406
    407     // Save the data
     407    // Save the data.
    408408    $attachment_id = wp_insert_attachment( $attachment, $file, $post_id, true );
    409409
     
    491491    unset( $attachment['ID'] );
    492492
    493     // Save the attachment metadata
     493    // Save the attachment metadata.
    494494    $attachment_id = wp_insert_attachment( $attachment, $file, $post_id, true );
    495495
     
    520520
    521521    wp_enqueue_style( 'colors' );
    522     // Check callback name for 'media'
     522    // Check callback name for 'media'.
    523523    if (
    524524        ( is_array( $content_func ) && ! empty( $content_func[1] ) && 0 === strpos( (string) $content_func[1], 'media' ) ) ||
     
    850850    if ( isset( $_POST['html-upload'] ) && ! empty( $_FILES ) ) {
    851851        check_admin_referer( 'media-form' );
    852         // Upload File button was clicked
     852        // Upload File button was clicked.
    853853        $id = media_handle_upload( 'async-upload', $_REQUEST['post_id'] );
    854854        unset( $_FILES );
     
    14221422    }
    14231423
    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     */
    14261430    $form_fields = array_merge_recursive( $form_fields, (array) $errors );
    14271431
     
    15971601    }
    15981602
    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.
    16001604    $display_title = $parsed_args['show_title'] ? "<div class='filename new'><span class='title'>" . wp_html_excerpt( $display_title, 60, '&hellip;' ) . '</span></div>' : '';
    16011605
     
    17111715    if ( isset( $_GET['post_id'] ) ) {
    17121716        $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.
    17141718        $calling_post_id = $post->post_parent;
    17151719    }
     
    18761880    }
    18771881
    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     */
    18801888    $form_fields = array_merge_recursive( $form_fields, (array) $args['errors'] );
    18811889
     
    21332141    );
    21342142
    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     */
    21372148    if (
    21382149        wp_is_mobile() &&
     
    27012712            }
    27022713        }
    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.
    27042715        if ( empty( $_GET['post_mime_type'] ) && ! empty( $num_posts[ $type ] ) ) {
    27052716            $_GET['post_mime_type']                        = $type;
Note: See TracChangeset for help on using the changeset viewer.