Make WordPress Core


Ignore:
Timestamp:
01/29/2020 12:43:23 AM (4 years ago)
Author:
SergeyBiryukov
Message:

Docs: Improve inline comments per the documentation standards.

Includes minor code layout fixes for better readability.

See #48303.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-custom-image-header.php

    r45932 r47122  
    801801
    802802        $max_width = 0;
    803         // For flex, limit size of image displayed to 1500px unless theme says otherwise
     803        // For flex, limit size of image displayed to 1500px unless theme says otherwise.
    804804        if ( current_theme_supports( 'custom-header', 'flex-width' ) ) {
    805805            $max_width = 1500;
     
    811811        $max_width = max( $max_width, get_theme_support( 'custom-header', 'width' ) );
    812812
    813         // If flexible height isn't supported and the image is the exact right size
     813        // If flexible height isn't supported and the image is the exact right size.
    814814        if ( ! current_theme_supports( 'custom-header', 'flex-height' ) && ! current_theme_supports( 'custom-header', 'flex-width' )
    815815            && $width == get_theme_support( 'custom-header', 'width' ) && $height == get_theme_support( 'custom-header', 'height' ) ) {
    816             // Add the meta-data
     816            // Add the metadata.
    817817            if ( file_exists( $file ) ) {
    818818                wp_update_attachment_metadata( $attachment_id, wp_generate_attachment_metadata( $attachment_id, $file ) );
     
    829829             * @param int    $attachment_id Attachment ID.
    830830             */
    831             do_action( 'wp_create_file_in_uploads', $file, $attachment_id ); // For replication
     831            do_action( 'wp_create_file_in_uploads', $file, $attachment_id ); // For replication.
    832832
    833833            return $this->finished();
     
    840840
    841841            /** This filter is documented in wp-admin/includes/class-custom-image-header.php */
    842             $image = apply_filters( 'wp_create_file_in_uploads', $image, $attachment_id ); // For replication
     842            $image = apply_filters( 'wp_create_file_in_uploads', $image, $attachment_id ); // For replication.
    843843
    844844            $url    = str_replace( wp_basename( $url ), wp_basename( $image ), $url );
     
    911911        $filename = wp_basename( $file );
    912912
    913         // Construct the object array
     913        // Construct the object array.
    914914        $object = array(
    915915            'post_title'     => $filename,
     
    920920        );
    921921
    922         // Save the data
     922        // Save the data.
    923923        $attachment_id = wp_insert_attachment( $object, $file );
    924924        return compact( 'attachment_id', 'file', 'filename', 'url', 'type' );
     
    983983
    984984        /** This filter is documented in wp-admin/includes/class-custom-image-header.php */
    985         $cropped = apply_filters( 'wp_create_file_in_uploads', $cropped, $attachment_id ); // For replication
     985        $cropped = apply_filters( 'wp_create_file_in_uploads', $cropped, $attachment_id ); // For replication.
    986986
    987987        $object = $this->create_attachment_object( $cropped, $attachment_id );
     
    991991        }
    992992
    993         // Update the attachment
     993        // Update the attachment.
    994994        $attachment_id = $this->insert_attachment( $object, $cropped );
    995995
     
    11811181        );
    11821182
    1183         // For flex, limit size of image displayed to 1500px unless theme says otherwise
     1183        // For flex, limit size of image displayed to 1500px unless theme says otherwise.
    11841184        if ( $has_flex_width ) {
    11851185            $max_width = 1500;
     
    13191319
    13201320        /** This filter is documented in wp-admin/includes/class-custom-image-header.php */
    1321         $cropped = apply_filters( 'wp_create_file_in_uploads', $cropped, $attachment_id ); // For replication
     1321        $cropped = apply_filters( 'wp_create_file_in_uploads', $cropped, $attachment_id ); // For replication.
    13221322
    13231323        $object = $this->create_attachment_object( $cropped, $attachment_id );
     
    14351435        $default = get_theme_support( 'custom-header', 'default-image' );
    14361436
    1437         if ( ! $default ) { // If not,
    1438             return $this->default_headers; // easy peasy.
     1437        if ( ! $default ) { // If not, easy peasy.
     1438            return $this->default_headers;
    14391439        }
    14401440
Note: See TracChangeset for help on using the changeset viewer.