Make WordPress Core

Changeset 30646


Ignore:
Timestamp:
11/30/2014 10:05:26 AM (10 years ago)
Author:
DrewAPicture
Message:

Improve inline documentation for image_constrain_size_for_editor().

Includes:

  • Proper formatting, plus adding a type for the $context parameter
  • Inline @see tags in the description and backtick-escaping inline code
  • Parameter, type, and description alignment

Props tillkruess for the initial patch.
Fixes #30508.

File:
1 edited

Legend:

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

    r30639 r30646  
    1212 * This is so that the image is a better fit for the editor and theme.
    1313 *
    14  * The $size parameter accepts either an array or a string. The supported string
     14 * The `$size` parameter accepts either an array or a string. The supported string
    1515 * values are 'thumb' or 'thumbnail' for the given thumbnail size or defaults at
    1616 * 128 width and 96 height in pixels. Also supported for the string value is
     
    1919 * not set.
    2020 *
    21  * Finally, there is a filter named 'editor_max_image_size', that will be called
    22  * on the calculated array for width and height, respectively. The second
     21 * Finally, there is a filter named {@see 'editor_max_image_size'}, that will be
     22 * called on the calculated array for width and height, respectively. The second
    2323 * parameter will be the value that was in the $size parameter. The returned
    2424 * type for the hook is an array with the width as the first element and the
     
    2727 * @since 2.5.0
    2828 *
    29  * @param int $width Width of the image
    30  * @param int $height Height of the image
    31  * @param string|array $size Size of what the result image should be.
    32  * @param context Could be 'display' (like in a theme) or 'edit' (like inserting into an editor)
     29 * @param int          $width   Width of the image in pixels.
     30 * @param int          $height  Height of the image in pixels.
     31 * @param string|array $size    Optional. Size or array of sizes of what the result image
     32 *                              should be. Accepts any valid image size name. Default 'medium'.
     33 * @param string       $context Optional. Could be 'display' (like in a theme) or 'edit'
     34 *                              (like inserting into an editor). Default null.
    3335 * @return array Width and height of what the result image should resize to.
    3436 */
    35 function image_constrain_size_for_editor($width, $height, $size = 'medium', $context = null ) {
     37function image_constrain_size_for_editor( $width, $height, $size = 'medium', $context = null ) {
    3638    global $content_width, $_wp_additional_image_sizes;
    3739
Note: See TracChangeset for help on using the changeset viewer.