<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[49021] trunk/src: Media: Standardise the description for image size parameters.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/49021">49021</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/49021","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>johnbillion</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2020-09-20 16:21:42 +0000 (Sun, 20 Sep 2020)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Media: Standardise the description for image size parameters.
This brings continuity to all the image related functions and filters which accept or pass a size parameter.
Props dilipbheda, johnbillion
Fixes <a href="https://core.trac.wordpress.org/ticket/47364">#47364</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadminincludesimagephp">trunk/src/wp-admin/includes/image.php</a></li>
<li><a href="#trunksrcwpadminincludesmediaphp">trunk/src/wp-admin/includes/media.php</a></li>
<li><a href="#trunksrcwpadminincludespostphp">trunk/src/wp-admin/includes/post.php</a></li>
<li><a href="#trunksrcwpincludesmediaphp">trunk/src/wp-includes/media.php</a></li>
<li><a href="#trunksrcwpincludesposttemplatephp">trunk/src/wp-includes/post-template.php</a></li>
<li><a href="#trunksrcwpincludespostthumbnailtemplatephp">trunk/src/wp-includes/post-thumbnail-template.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadminincludesimagephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/image.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/image.php 2020-09-20 15:53:52 UTC (rev 49020)
+++ trunk/src/wp-admin/includes/image.php 2020-09-20 16:21:42 UTC (rev 49021)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -917,9 +917,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.9.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int $attachment_id Attachment ID.
- * @param string $mime_type Image mime type.
- * @param string $size Optional. Image size. Default 'full'.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int $attachment_id Attachment ID.
+ * @param string $mime_type Image mime type.
+ * @param string|int[] $size Optional. Image size. Accepts any registered image size name, or an array
+ * of width and height values in pixels (in that order). Default 'full'.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return resource|GdImage|false The resulting image resource or GdImage instance on success,
</span><span class="cx" style="display: block; padding: 0 10px"> * false on failure.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -952,7 +953,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param resource|GdImage $image Current image.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $attachment_id Attachment ID.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $size Image size.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|int[] $size Requested image size. Can be any registered image size name, or
+ * an array of width and height values in pixels (in that order).
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> $image = apply_filters( 'load_image_to_edit', $image, $attachment_id, $size );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -974,9 +976,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.4.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @access private
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int $attachment_id Attachment ID.
- * @param string $size Optional. Image size. Default 'full'.
- * @return string|false File path or url on success, false on failure.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int $attachment_id Attachment ID.
+ * @param string|int[] $size Optional. Image size. Accepts any registered image size name, or an array
+ * of width and height values in pixels (in that order). Default 'full'.
+ * @return string|false File path or URL on success, false on failure.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function _load_image_to_edit_path( $attachment_id, $size = 'full' ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $filepath = get_attached_file( $attachment_id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -995,9 +998,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.1.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $path Path to the current image.
- * @param int $attachment_id Attachment ID.
- * @param string $size Size of the image.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $path Path to the current image.
+ * @param int $attachment_id Attachment ID.
+ * @param string|int[] $size Requested image size. Can be any registered image size name, or
+ * an array of width and height values in pixels (in that order).
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> $filepath = apply_filters( 'load_image_to_edit_filesystempath', $filepath, $attachment_id, $size );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1010,9 +1014,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.1.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $image_url Current image URL.
- * @param int $attachment_id Attachment ID.
- * @param string $size Size of the image.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $image_url Current image URL.
+ * @param int $attachment_id Attachment ID.
+ * @param string|int[] $size Requested image size. Can be any registered image size name, or
+ * an array of width and height values in pixels (in that order).
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> $filepath = apply_filters( 'load_image_to_edit_attachmenturl', wp_get_attachment_url( $attachment_id ), $attachment_id, $size );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1022,9 +1027,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.9.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string|bool $filepath File path or URL to current image, or false.
- * @param int $attachment_id Attachment ID.
- * @param string $size Size of the image.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|bool $filepath File path or URL to current image, or false.
+ * @param int $attachment_id Attachment ID.
+ * @param string|int[] $size Requested image size. Can be any registered image size name, or
+ * an array of width and height values in pixels (in that order).
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> return apply_filters( 'load_image_to_edit_path', $filepath, $attachment_id, $size );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpadminincludesmediaphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/media.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/media.php 2020-09-20 15:53:52 UTC (rev 49020)
+++ trunk/src/wp-admin/includes/media.php 2020-09-20 16:21:42 UTC (rev 49021)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -125,8 +125,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $align Image CSS alignment property.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $url Optional. Image src URL. Default empty.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param bool|string $rel Optional. Value for rel attribute or whether to add a default value. Default false.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string|array $size Optional. Image size. Accepts any valid image size, or an array of width
- * and height values in pixels (in that order). Default 'medium'.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|int[] $size Optional. Image size. Accepts any registered image size name, or an array of
+ * width and height values in pixels (in that order). Default 'medium'.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $alt Optional. Image alt attribute. Default empty.
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string The HTML output to insert into the editor.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -160,8 +160,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $title The image title.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $align The image alignment.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $url The image source URL.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string|array $size Size of image. Image size or array of width and height values
- * (in that order). Default 'medium'.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|int[] $size Requested image size. Can be any registered image size name, or
+ * an array of width and height values in pixels (in that order).
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $alt The image alternative, or alt, text.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $rel The image rel attribute.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span></span></pre></div>
<a id="trunksrcwpadminincludespostphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/post.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/post.php 2020-09-20 15:53:52 UTC (rev 49020)
+++ trunk/src/wp-admin/includes/post.php 2020-09-20 16:21:42 UTC (rev 49021)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1536,15 +1536,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * Note: When a theme adds 'post-thumbnail' support, a special 'post-thumbnail'
</span><span class="cx" style="display: block; padding: 0 10px"> * image size is registered, which differs from the 'thumbnail' image size
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * managed via the Settings > Media screen. See the `$size` parameter description
- * for more information on default values.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * managed via the Settings > Media screen.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.4.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string|array $size Post thumbnail image size to display in the meta box. Accepts any valid
- * image size, or an array of width and height values in pixels (in that order).
- * If the 'post-thumbnail' size is set, default is 'post-thumbnail'. Otherwise,
- * default is an array with 266 as both the height and width values.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|int[] $size Requested image size. Can be any registered image size name, or
+ * an array of width and height values in pixels (in that order).
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param int $thumbnail_id Post thumbnail attachment ID.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param WP_Post $post The post object associated with the thumbnail.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span></span></pre></div>
<a id="trunksrcwpincludesmediaphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/media.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/media.php 2020-09-20 15:53:52 UTC (rev 49020)
+++ trunk/src/wp-includes/media.php 2020-09-20 16:21:42 UTC (rev 49021)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -46,9 +46,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $width Width of the image in pixels.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $height Height of the image in pixels.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string|array $size Optional. Image size. Accepts any valid image size, or an array
- * of width and height values in pixels (in that order).
- * Default 'medium'.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|int[] $size Optional. Image size. Accepts any registered image size name, or an array
+ * of width and height values in pixels (in that order). Default 'medium'.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $context Optional. Could be 'display' (like in a theme) or 'edit'
</span><span class="cx" style="display: block; padding: 0 10px"> * (like inserting into an editor). Default null.
</span><span class="cx" style="display: block; padding: 0 10px"> * @return int[] {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -125,10 +124,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @type int $0 The maximum width in pixels.
</span><span class="cx" style="display: block; padding: 0 10px"> * @type int $1 The maximum height in pixels.
</span><span class="cx" style="display: block; padding: 0 10px"> * }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string|array $size Size of what the result image should be.
- * @param string $context The context the image is being resized for.
- * Possible values are 'display' (like in a theme)
- * or 'edit' (like inserting into an editor).
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|int[] $size Requested image size. Can be any registered image size name, or
+ * an array of width and height values in pixels (in that order).
+ * @param string $context The context the image is being resized for.
+ * Possible values are 'display' (like in a theme)
+ * or 'edit' (like inserting into an editor).
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> list( $max_width, $max_height ) = apply_filters( 'editor_max_image_size', array( $max_width, $max_height ), $size, $context );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -177,9 +177,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $id Attachment ID for image.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string|int[] $size Optional. Image size to scale to. Accepts any valid image size name,
- * or an array of width and height values in pixels (in that order).
- * Default 'medium'.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|int[] $size Optional. Image size. Accepts any registered image size name, or an array
+ * of width and height values in pixels (in that order). Default 'medium'.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return array|false {
</span><span class="cx" style="display: block; padding: 0 10px"> * Array of image data, or boolean false if no image is available.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -202,8 +201,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param bool|array $downsize Whether to short-circuit the image downsize.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $id Attachment ID for image.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array|string $size Requested size of image. Image size name, or array of width
- * and height values (in that order).
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|int[] $size Requested image size. Can be any registered image size name, or
+ * an array of width and height values in pixels (in that order).
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> $out = apply_filters( 'image_downsize', false, $id, $size );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -367,9 +366,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $alt Image description for the alt attribute.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $title Image description for the title attribute.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $align Part of the class name for aligning the image.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string|array $size Optional. Registered image size to retrieve a tag for. Accepts any
- * valid image size, or an array of width and height values in pixels
- * (in that order). Default 'medium'.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|int[] $size Optional. Image size. Accepts any registered image size name, or an array of
+ * width and height values in pixels (in that order). Default 'medium'.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return string HTML IMG element for given image attachment
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function get_image_tag( $id, $alt, $title, $align, $size = 'medium' ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -389,8 +387,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $class CSS class name or space-separated list of classes.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $id Attachment ID.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $align Part of the class name for aligning the image.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string|array $size Size of image. Image size or array of width and height values (in that order).
- * Default 'medium'.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|int[] $size Requested image size. Can be any registered image size name, or
+ * an array of width and height values in pixels (in that order).
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> $class = apply_filters( 'get_image_tag_class', $class, $id, $align, $size );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -406,8 +404,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $alt Image description for the alt attribute.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $title Image description for the title attribute.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $align Part of the class name for aligning the image.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string|array $size Size of image. Image size or array of width and height values (in that order).
- * Default 'medium'.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|int[] $size Requested image size. Can be any registered image size name, or
+ * an array of width and height values in pixels (in that order).
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> return apply_filters( 'get_image_tag', $html, $id, $alt, $title, $align, $size );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -744,9 +742,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $post_id Attachment ID.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array|string $size Optional. Image size. Accepts any valid image size, or an array
- * of width and height values in pixels (in that order).
- * Default 'thumbnail'.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|int[] $size Optional. Image size. Accepts any registered image size name, or an array
+ * of width and height values in pixels (in that order). Default 'thumbnail'.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return array|false {
</span><span class="cx" style="display: block; padding: 0 10px"> * Array of file relative path, width, and height on success. Additionally includes absolute
</span><span class="cx" style="display: block; padding: 0 10px"> * path and URL if registered size is passed to `$size` parameter. False on failure.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -844,9 +841,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $data Array of file relative path, width, and height on success. May also include
</span><span class="cx" style="display: block; padding: 0 10px"> * file absolute path and URL.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int $post_id The post_id of the image attachment
- * @param string|array $size Registered image size or flat array of initially-requested height and width
- * dimensions (in that order).
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int $post_id The ID of the image attachment.
+ * @param string|int[] $size Requested image size. Can be any registered image size name, or
+ * an array of width and height values in pixels (in that order).
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> return apply_filters( 'image_get_intermediate_size', $data, $post_id, $size );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -938,8 +935,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $attachment_id Image attachment ID.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string|int[] $size Optional. Image size. Accepts any valid image size name, or an array of width
- * and height values in pixels (in that order). Default 'thumbnail'.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|int[] $size Optional. Image size. Accepts any registered image size name, or an array of
+ * width and height values in pixels (in that order). Default 'thumbnail'.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param bool $icon Optional. Whether the image should fall back to a mime type icon. Default false.
</span><span class="cx" style="display: block; padding: 0 10px"> * @return array|false {
</span><span class="cx" style="display: block; padding: 0 10px"> * Array of image data, or boolean false if no image is available.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -986,8 +983,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @type bool $3 Whether the image is a resized image.
</span><span class="cx" style="display: block; padding: 0 10px"> * }
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $attachment_id Image attachment ID.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string|int[] $size Requested size of image. Image size name, or array of width
- * and height values (in that order).
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|int[] $size Requested image size. Can be any registered image size name, or
+ * an array of width and height values in pixels (in that order).
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param bool $icon Whether the image should be treated as an icon.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> return apply_filters( 'wp_get_attachment_image_src', $image, $attachment_id, $size, $icon );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1006,8 +1003,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 5.5.0 The `$loading` attribute was added.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $attachment_id Image attachment ID.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string|array $size Optional. Image size. Accepts any valid image size, or an array of width
- * and height values in pixels (in that order). Default 'thumbnail'.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|int[] $size Optional. Image size. Accepts any registered image size name, or an array
+ * of width and height values in pixels (in that order). Default 'thumbnail'.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param bool $icon Optional. Whether the image should be treated as an icon. Default false.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string|array $attr {
</span><span class="cx" style="display: block; padding: 0 10px"> * Optional. Attributes for the image markup.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1086,8 +1083,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $attr Array of attribute values for the image markup, keyed by attribute name.
</span><span class="cx" style="display: block; padding: 0 10px"> * See wp_get_attachment_image().
</span><span class="cx" style="display: block; padding: 0 10px"> * @param WP_Post $attachment Image attachment post.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string|array $size Requested size. Image size or array of width and height values
- * (in that order). Default 'thumbnail'.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|int[] $size Requested image size. Can be any registered image size name, or
+ * an array of width and height values in pixels (in that order).
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> $attr = apply_filters( 'wp_get_attachment_image_attributes', $attr, $attachment, $size );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1110,8 +1107,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.4.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $attachment_id Image attachment ID.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string|array $size Optional. Image size to retrieve. Accepts any valid image size, or an array
- * of width and height values in pixels (in that order). Default 'thumbnail'.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|int[] $size Optional. Image size. Accepts any registered image size name, or an array of
+ * width and height values in pixels (in that order). Default 'thumbnail'.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param bool $icon Optional. Whether the image should be treated as an icon. Default false.
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string|false Attachment URL or false if no image is available.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1186,7 +1183,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @see wp_calculate_image_srcset()
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $attachment_id Image attachment ID.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array|string $size Optional. Image size. Accepts any valid image size, or an array of
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|int[] $size Optional. Image size. Accepts any registered image size name, or an array of
</ins><span class="cx" style="display: block; padding: 0 10px"> * width and height values in pixels (in that order). Default 'medium'.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $image_meta Optional. The image meta data as returned by 'wp_get_attachment_metadata()'.
</span><span class="cx" style="display: block; padding: 0 10px"> * Default null.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1427,8 +1424,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @see wp_calculate_image_sizes()
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $attachment_id Image attachment ID.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array|string $size Optional. Image size. Accepts any valid image size, or an array of width
- * and height values in pixels (in that order). Default 'medium'.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|int[] $size Optional. Image size. Accepts any registered image size name, or an array of
+ * width and height values in pixels (in that order). Default 'medium'.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param array $image_meta Optional. The image meta data as returned by 'wp_get_attachment_metadata()'.
</span><span class="cx" style="display: block; padding: 0 10px"> * Default null.
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string|bool A valid source size value for use in a 'sizes' attribute or false.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1458,8 +1455,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.4.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array|string $size Image size to retrieve. Accepts any valid image size, or an array
- * of width and height values in pixels (in that order). Default 'medium'.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|int[] $size Image size. Accepts any registered image size name, or an array of
+ * width and height values in pixels (in that order).
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $image_src Optional. The URL to the image file. Default null.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $image_meta Optional. The image meta data as returned by 'wp_get_attachment_metadata()'.
</span><span class="cx" style="display: block; padding: 0 10px"> * Default null.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1498,8 +1495,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.4.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $sizes A source size value for use in a 'sizes' attribute.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array|string $size Requested size. Image size or array of width and height values
- * in pixels (in that order).
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|int[] $size Requested image size. Can be any registered image size name, or
+ * an array of width and height values in pixels (in that order).
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string|null $image_src The URL to the image file or null.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array|null $image_meta The image meta data as returned by wp_get_attachment_metadata() or null.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $attachment_id Image attachment ID of the original image or 0.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2154,8 +2151,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @type string $captiontag HTML tag to use for each image's caption.
</span><span class="cx" style="display: block; padding: 0 10px"> * Default 'dd', or 'figcaption' when the theme registers HTML5 gallery support.
</span><span class="cx" style="display: block; padding: 0 10px"> * @type int $columns Number of columns of images to display. Default 3.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string|array $size Size of the images to display. Accepts any valid image size, or an array of width
- * and height values in pixels (in that order). Default 'thumbnail'.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @type string|int[] $size Size of the images to display. Accepts any registered image size name, or an array
+ * of width and height values in pixels (in that order). Default 'thumbnail'.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @type string $ids A comma-separated list of IDs of attachments to display. Default empty.
</span><span class="cx" style="display: block; padding: 0 10px"> * @type string $include A comma-separated list of IDs of attachments to include. Default empty.
</span><span class="cx" style="display: block; padding: 0 10px"> * @type string $exclude A comma-separated list of IDs of attachments to exclude. Default empty.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3282,9 +3279,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @see adjacent_image_link()
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string|array $size Optional. Image size. Accepts any valid image size, an array of width and
- * height values in pixels (in that order), 0, or 'none'. 0 or 'none' will
- * default to 'post_title' or `$text`. Default 'thumbnail'.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|int[] $size Optional. Image size. Accepts any registered image size name, or an array
+ * of width and height values in pixels (in that order). Default 'thumbnail'.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $text Optional. Link text. Default false.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function previous_image_link( $size = 'thumbnail', $text = false ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3298,9 +3294,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @see adjacent_image_link()
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string|array $size Optional. Image size. Accepts any valid image size, an array of width and
- * height values in pixels (in that order), 0, or 'none'. 0 or 'none' will
- * default to 'post_title' or `$text`. Default 'thumbnail'.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|int[] $size Optional. Image size. Accepts any registered image size name, or an array
+ * of width and height values in pixels (in that order). Default 'thumbnail'.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $text Optional. Link text. Default false.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function next_image_link( $size = 'thumbnail', $text = false ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3315,8 +3310,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param bool $prev Optional. Whether to display the next (false) or previous (true) link. Default true.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string|array $size Optional. Image size. Accepts any valid image size, or an array of width and height
- * values in pixels (in that order). Default 'thumbnail'.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|int[] $size Optional. Image size. Accepts any registered image size name, or an array
+ * of width and height values in pixels (in that order). Default 'thumbnail'.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param bool $text Optional. Link text. Default false.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function adjacent_image_link( $prev = true, $size = 'thumbnail', $text = false ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3364,7 +3359,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $output Adjacent image HTML markup.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $attachment_id Attachment ID
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $size Image size.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|int[] $size Requested image size. Can be any registered image size name, or
+ * an array of width and height values in pixels (in that order).
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $text Link text.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> echo apply_filters( "{$adjacent}_image_link", $output, $attachment_id, $size, $text );
</span></span></pre></div>
<a id="trunksrcwpincludesposttemplatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/post-template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/post-template.php 2020-09-20 15:53:52 UTC (rev 49020)
+++ trunk/src/wp-includes/post-template.php 2020-09-20 16:21:42 UTC (rev 49021)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1596,9 +1596,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.4.0 The `$id` parameter can now accept either a post ID or `WP_Post` object.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int|WP_Post $id Optional. Post ID or post object.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string|array $size Optional. Image size. Accepts any valid image size, or an array
- * of width and height values in pixels (in that order).
- * Default 'thumbnail'.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|int[] $size Optional. Image size. Accepts any registered image size name, or an array
+ * of width and height values in pixels (in that order). Default 'thumbnail'.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param bool $permalink Optional. Whether to add permalink to image. Default false.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param bool $icon Optional. Whether the attachment is an icon. Default false.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string|false $text Optional. Link text to use. Activated by passing a string, false otherwise.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1642,8 +1641,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $link_html The page link HTML output.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $id Post ID.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string|array $size Size of the image. Image size or array of width and height values (in that order).
- * Default 'thumbnail'.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|int[] $size Requested image size. Can be any registered image size name, or
+ * an array of width and height values in pixels (in that order).
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param bool $permalink Whether to add permalink to image. Default false.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param bool $icon Whether to include an icon.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string|bool $text If string, will be link text.
</span></span></pre></div>
<a id="trunksrcwpincludespostthumbnailtemplatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/post-thumbnail-template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/post-thumbnail-template.php 2020-09-20 15:53:52 UTC (rev 49020)
+++ trunk/src/wp-includes/post-thumbnail-template.php 2020-09-20 16:21:42 UTC (rev 49021)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -74,9 +74,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @see get_the_post_thumbnail()
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string|array $size Optional. Image size to use. Accepts any valid image size, or
- * an array of width and height values in pixels (in that order).
- * Default 'post-thumbnail'.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|int[] $size Optional. Image size. Accepts any registered image size name, or an array of
+ * width and height values in pixels (in that order). Default 'post-thumbnail'.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string|array $attr Optional. Query string or array of attributes. Default empty.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function the_post_thumbnail( $size = 'post-thumbnail', $attr = '' ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -131,9 +130,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.4.0 `$post` can be a post ID or WP_Post object.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string|array $size Optional. Image size to use. Accepts any valid image size, or
- * an array of width and height values in pixels (in that order).
- * Default 'post-thumbnail'.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|int[] $size Optional. Image size. Accepts any registered image size name, or an array of
+ * width and height values in pixels (in that order). Default 'post-thumbnail'.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string|array $attr Optional. Query string or array of attributes. Default empty.
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string The post thumbnail image tag.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -152,8 +150,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.9.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.9.0 Added the `$post_id` parameter.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string|array $size The post thumbnail size. Image size or array of width and height
- * values (in that order). Default 'post-thumbnail'.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|int[] $size Requested image size. Can be any registered image size name, or
+ * an array of width and height values in pixels (in that order).
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param int $post_id The post ID.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> $size = apply_filters( 'post_thumbnail_size', $size, $post->ID );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -169,8 +167,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $post_id The post ID.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $post_thumbnail_id The post thumbnail ID.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string|array $size The post thumbnail size. Image size or array of width
- * and height values (in that order). Default 'post-thumbnail'.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|int[] $size Requested image size. Can be any registered image size name, or
+ * an array of width and height values in pixels (in that order).
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( 'begin_fetch_post_thumbnail_html', $post->ID, $post_thumbnail_id, $size );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -187,8 +185,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $post_id The post ID.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $post_thumbnail_id The post thumbnail ID.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string|array $size The post thumbnail size. Image size or array of width
- * and height values (in that order). Default 'post-thumbnail'.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|int[] $size Requested image size. Can be any registered image size name, or
+ * an array of width and height values in pixels (in that order).
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( 'end_fetch_post_thumbnail_html', $post->ID, $post_thumbnail_id, $size );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -204,8 +202,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $html The post thumbnail HTML.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $post_id The post ID.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $post_thumbnail_id The post thumbnail ID.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string|array $size The post thumbnail size. Image size or array of width and height
- * values (in that order). Default 'post-thumbnail'.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|int[] $size Requested image size. Can be any registered image size name, or
+ * an array of width and height values in pixels (in that order).
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $attr Query string of attributes.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> return apply_filters( 'post_thumbnail_html', $html, $post->ID, $post_thumbnail_id, $size, $attr );
</span></span></pre>
</div>
</div>
</body>
</html>