<!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>[56767] trunk/src/wp-includes: Docs: Improve documentation for `get_avatar()` and related functions.</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/56767">56767</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/56767","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>SergeyBiryukov</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2023-10-03 16:13:43 +0000 (Tue, 03 Oct 2023)</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'>Docs: Improve documentation for `get_avatar()` and related functions.
Includes:
* Expanding and synchronizing documentation for the `default` and `rating` arguments.
* Adding `@since` entries for the `loading`, `fetchpriority`, and `decoding` arguments.
* Wrapping long lines as per the documentation standards.
* Fixing a typo in the `identicon` value.
* Minor formatting edits for consistency.
Follow-up to <a href="https://core.trac.wordpress.org/changeset/31107">[31107]</a>, <a href="https://core.trac.wordpress.org/changeset/45632">[45632]</a>, <a href="https://core.trac.wordpress.org/changeset/47554">[47554]</a>, <a href="https://core.trac.wordpress.org/changeset/53480">[53480]</a>, <a href="https://core.trac.wordpress.org/changeset/56037">[56037]</a>.
See <a href="https://core.trac.wordpress.org/ticket/58833">#58833</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludeslinktemplatephp">trunk/src/wp-includes/link-template.php</a></li>
<li><a href="#trunksrcwpincludespluggablephp">trunk/src/wp-includes/pluggable.php</a></li>
<li><a href="#trunksrcwpincludesrestapiphp">trunk/src/wp-includes/rest-api.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpincludeslinktemplatephp"></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/link-template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/link-template.php 2023-10-03 15:42:06 UTC (rev 56766)
+++ trunk/src/wp-includes/link-template.php 2023-10-03 16:13:43 UTC (rev 56767)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4250,27 +4250,37 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Retrieves the avatar URL.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.2.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 mixed $id_or_email The Gravatar to retrieve a URL for. Accepts a user_id, gravatar md5 hash,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param mixed $id_or_email The avatar to retrieve a URL for. Accepts a user ID, Gravatar MD5 hash,
</ins><span class="cx" style="display: block; padding: 0 10px"> * user email, WP_User object, WP_Post object, or WP_Comment object.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $args {
</span><span class="cx" style="display: block; padding: 0 10px"> * Optional. Arguments to use instead of the default arguments.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @type int $size Height and width of the avatar in pixels. Default 96.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string $default URL for the default image or a default type. Accepts '404' (return
- * a 404 instead of a default image), 'retro' (8bit), 'RoboHash' (robohash),
- * 'monsterid' (monster), 'wavatar' (cartoon face), 'indenticon' (the "quilt"),
- * 'mystery', 'mm', or 'mysteryman' (The Oyster Man), 'blank' (transparent GIF),
- * or 'gravatar_default' (the Gravatar logo). Default is the value of the
- * 'avatar_default' option, with a fallback of 'mystery'.
- * @type bool $force_default Whether to always show the default image, never the Gravatar. Default false.
- * @type string $rating What rating to display avatars up to. Accepts 'G', 'PG', 'R', 'X', and are
- * judged in that order. Default is the value of the 'avatar_rating' option.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @type string $default URL for the default image or a default type. Accepts:
+ * - '404' (return a 404 instead of a default image)
+ * - 'retro' (a 8-bit arcade-style pixelated face)
+ * - 'robohash' (a robot)
+ * - 'monsterid' (a monster)
+ * - 'wavatar' (a cartoon face)
+ * - 'identicon' (the "quilt", a geometric pattern)
+ * - 'mystery', 'mm', or 'mysteryman' (The Oyster Man)
+ * - 'blank' (transparent GIF)
+ * - 'gravatar_default' (the Gravatar logo)
+ * Default is the value of the 'avatar_default' option,
+ * with a fallback of 'mystery'.
+ * @type bool $force_default Whether to always show the default image, never the Gravatar.
+ * Default false.
+ * @type string $rating What rating to display avatars up to. Accepts:
+ * - 'G' (suitable for all audiences)
+ * - 'PG' (possibly offensive, usually for audiences 13 and above)
+ * - 'R' (intended for adult audiences above 17)
+ * - 'X' (even more mature than above)
+ * Default is the value of the 'avatar_rating' option.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @type string $scheme URL scheme to use. See set_url_scheme() for accepted values.
</span><span class="cx" style="display: block; padding: 0 10px"> * Default null.
</span><span class="cx" style="display: block; padding: 0 10px"> * @type array $processed_args When the function returns, the value will be the processed/sanitized $args
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4283,7 +4293,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $args['url'];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Check if this comment type allows avatars to be retrieved.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4305,7 +4314,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return in_array( $comment_type, (array) $allowed_comment_types, true );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Retrieves default data about the avatar.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4316,23 +4324,35 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $args {
</span><span class="cx" style="display: block; padding: 0 10px"> * Optional. Arguments to use instead of the default arguments.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type int $size Height and width of the avatar image file in pixels. Default 96.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @type int $size Height and width of the avatar in pixels. Default 96.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @type int $height Display height of the avatar in pixels. Defaults to $size.
</span><span class="cx" style="display: block; padding: 0 10px"> * @type int $width Display width of the avatar in pixels. Defaults to $size.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string $default URL for the default image or a default type. Accepts '404' (return
- * a 404 instead of a default image), 'retro' (8bit), 'monsterid' (monster),
- * 'wavatar' (cartoon face), 'indenticon' (the "quilt"), 'mystery', 'mm',
- * or 'mysteryman' (The Oyster Man), 'blank' (transparent GIF), or
- * 'gravatar_default' (the Gravatar logo). Default is the value of the
- * 'avatar_default' option, with a fallback of 'mystery'.
- * @type bool $force_default Whether to always show the default image, never the Gravatar. Default false.
- * @type string $rating What rating to display avatars up to. Accepts 'G', 'PG', 'R', 'X', and are
- * judged in that order. Default is the value of the 'avatar_rating' option.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @type string $default URL for the default image or a default type. Accepts:
+ * - '404' (return a 404 instead of a default image)
+ * - 'retro' (a 8-bit arcade-style pixelated face)
+ * - 'robohash' (a robot)
+ * - 'monsterid' (a monster)
+ * - 'wavatar' (a cartoon face)
+ * - 'identicon' (the "quilt", a geometric pattern)
+ * - 'mystery', 'mm', or 'mysteryman' (The Oyster Man)
+ * - 'blank' (transparent GIF)
+ * - 'gravatar_default' (the Gravatar logo)
+ * Default is the value of the 'avatar_default' option,
+ * with a fallback of 'mystery'.
+ * @type bool $force_default Whether to always show the default image, never the Gravatar.
+ * Default false.
+ * @type string $rating What rating to display avatars up to. Accepts:
+ * - 'G' (suitable for all audiences)
+ * - 'PG' (possibly offensive, usually for audiences 13 and above)
+ * - 'R' (intended for adult audiences above 17)
+ * - 'X' (even more mature than above)
+ * Default is the value of the 'avatar_rating' option.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @type string $scheme URL scheme to use. See set_url_scheme() for accepted values.
</span><span class="cx" style="display: block; padding: 0 10px"> * Default null.
</span><span class="cx" style="display: block; padding: 0 10px"> * @type array $processed_args When the function returns, the value will be the processed/sanitized $args
</span><span class="cx" style="display: block; padding: 0 10px"> * plus a "found_avatar" guess. Pass as a reference. Default null.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string $extra_attr HTML attributes to insert in the IMG element. Is not sanitized. Default empty.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @type string $extra_attr HTML attributes to insert in the IMG element. Is not sanitized.
+ * Default empty.
</ins><span class="cx" style="display: block; padding: 0 10px"> * }
</span><span class="cx" style="display: block; padding: 0 10px"> * @return array {
</span><span class="cx" style="display: block; padding: 0 10px"> * Along with the arguments passed in `$args`, this will contain a couple of extra arguments.
</span></span></pre></div>
<a id="trunksrcwpincludespluggablephp"></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/pluggable.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/pluggable.php 2023-10-03 15:42:06 UTC (rev 56766)
+++ trunk/src/wp-includes/pluggable.php 2023-10-03 16:13:43 UTC (rev 56767)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2797,26 +2797,41 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Retrieves the avatar `<img>` tag for a user, email address, MD5 hash, comment, or post.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @since 4.2.0 Optional `$args` parameter added.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 4.2.0 Added the optional `$args` parameter.
+ * @since 5.5.0 Added the `loading` argument.
+ * @since 6.1.0 Added the `decoding` argument.
+ * @since 6.3.0 Added the `fetchpriority` argument.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param mixed $id_or_email The Gravatar to retrieve. Accepts a user_id, gravatar md5 hash,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param mixed $id_or_email The avatar to retrieve. Accepts a user ID, Gravatar MD5 hash,
</ins><span class="cx" style="display: block; padding: 0 10px"> * user email, WP_User object, WP_Post object, or WP_Comment object.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int $size Optional. Height and width of the avatar image file in pixels. Default 96.
- * @param string $default_value URL for the default image or a default type. Accepts '404' (return
- * a 404 instead of a default image), 'retro' (8bit), 'RoboHash' (robohash),
- * 'monsterid' (monster), 'wavatar' (cartoon face), 'indenticon' (the "quilt"),
- * 'mystery', 'mm', or 'mysteryman' (The Oyster Man), 'blank' (transparent GIF),
- * or 'gravatar_default' (the Gravatar logo). Default is the value of the
- * 'avatar_default' option, with a fallback of 'mystery'.
- * @param string $alt Optional. Alternative text to use in img tag. Default empty.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int $size Optional. Height and width of the avatar in pixels. Default 96.
+ * @param string $default_value URL for the default image or a default type. Accepts:
+ * - '404' (return a 404 instead of a default image)
+ * - 'retro' (a 8-bit arcade-style pixelated face)
+ * - 'robohash' (a robot)
+ * - 'monsterid' (a monster)
+ * - 'wavatar' (a cartoon face)
+ * - 'identicon' (the "quilt", a geometric pattern)
+ * - 'mystery', 'mm', or 'mysteryman' (The Oyster Man)
+ * - 'blank' (transparent GIF)
+ * - 'gravatar_default' (the Gravatar logo)
+ * Default is the value of the 'avatar_default' option,
+ * with a fallback of 'mystery'.
+ * @param string $alt Optional. Alternative text to use in the avatar image tag.
+ * Default empty.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param array $args {
</span><span class="cx" style="display: block; padding: 0 10px"> * Optional. Extra arguments to retrieve the avatar.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @type int $height Display height of the avatar in pixels. Defaults to $size.
</span><span class="cx" style="display: block; padding: 0 10px"> * @type int $width Display width of the avatar in pixels. Defaults to $size.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type bool $force_default Whether to always show the default image, never the Gravatar. Default false.
- * @type string $rating What rating to display avatars up to. Accepts 'G', 'PG', 'R', 'X', and are
- * judged in that order. Default is the value of the 'avatar_rating' option.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @type bool $force_default Whether to always show the default image, never the Gravatar.
+ * Default false.
+ * @type string $rating What rating to display avatars up to. Accepts:
+ * - 'G' (suitable for all audiences)
+ * - 'PG' (possibly offensive, usually for audiences 13 and above)
+ * - 'R' (intended for adult audiences above 17)
+ * - 'X' (even more mature than above)
+ * Default is the value of the 'avatar_rating' option.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @type string $scheme URL scheme to use. See set_url_scheme() for accepted values.
</span><span class="cx" style="display: block; padding: 0 10px"> * Default null.
</span><span class="cx" style="display: block; padding: 0 10px"> * @type array|string $class Array or string of additional classes to add to the img element.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2825,7 +2840,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Default false.
</span><span class="cx" style="display: block; padding: 0 10px"> * @type string $loading Value for the `loading` attribute.
</span><span class="cx" style="display: block; padding: 0 10px"> * Default null.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @type string $extra_attr HTML attributes to insert in the IMG element. Is not sanitized. Default empty.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @type string $fetchpriority Value for the `fetchpriority` attribute.
+ * Default null.
+ * @type string $decoding Value for the `decoding` attribute.
+ * Default null.
+ * @type string $extra_attr HTML attributes to insert in the IMG element. Is not sanitized.
+ * Default empty.
</ins><span class="cx" style="display: block; padding: 0 10px"> * }
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string|false `<img>` tag for the user's avatar. 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">@@ -2844,8 +2864,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'force_display' => false,
</span><span class="cx" style="display: block; padding: 0 10px"> 'loading' => null,
</span><span class="cx" style="display: block; padding: 0 10px"> 'fetchpriority' => null,
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'decoding' => null,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'extra_attr' => '',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'decoding' => null,
</del><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( empty( $args ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2883,7 +2903,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.2.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string|null $avatar HTML for the user's avatar. Default null.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param mixed $id_or_email The avatar to retrieve. Accepts a user_id, Gravatar MD5 hash,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param mixed $id_or_email The avatar to retrieve. Accepts a user ID, Gravatar MD5 hash,
</ins><span class="cx" style="display: block; padding: 0 10px"> * user email, WP_User object, WP_Post object, or WP_Comment object.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $args Arguments passed to get_avatar_url(), after processing.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2922,7 +2942,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Add `loading`, `fetchpriority` and `decoding` attributes.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Add `loading`, `fetchpriority`, and `decoding` attributes.
</ins><span class="cx" style="display: block; padding: 0 10px"> $extra_attr = $args['extra_attr'];
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( in_array( $args['loading'], array( 'lazy', 'eager' ), true )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2935,25 +2955,24 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $extra_attr .= "loading='{$args['loading']}'";
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( in_array( $args['decoding'], array( 'async', 'sync', 'auto' ), true )
- && ! preg_match( '/\bdecoding\s*=/', $extra_attr )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( in_array( $args['fetchpriority'], array( 'high', 'low', 'auto' ), true )
+ && ! preg_match( '/\bfetchpriority\s*=/', $extra_attr )
</ins><span class="cx" style="display: block; padding: 0 10px"> ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $extra_attr ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $extra_attr .= ' ';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $extra_attr .= "decoding='{$args['decoding']}'";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $extra_attr .= "fetchpriority='{$args['fetchpriority']}'";
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Add support for `fetchpriority`.
- if ( in_array( $args['fetchpriority'], array( 'high', 'low', 'auto' ), true )
- && ! preg_match( '/\bfetchpriority\s*=/', $extra_attr )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( in_array( $args['decoding'], array( 'async', 'sync', 'auto' ), true )
+ && ! preg_match( '/\bdecoding\s*=/', $extra_attr )
</ins><span class="cx" style="display: block; padding: 0 10px"> ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $extra_attr ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $extra_attr .= ' ';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $extra_attr .= "fetchpriority='{$args['fetchpriority']}'";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $extra_attr .= "decoding='{$args['decoding']}'";
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $avatar = sprintf(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2971,14 +2990,22 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Filters the HTML for a user's avatar.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @since 4.2.0 The `$args` parameter was added.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 4.2.0 Added the `$args` parameter.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $avatar HTML for the user's avatar.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param mixed $id_or_email The avatar to retrieve. Accepts a user_id, Gravatar MD5 hash,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param mixed $id_or_email The avatar to retrieve. Accepts a user ID, Gravatar MD5 hash,
</ins><span class="cx" style="display: block; padding: 0 10px"> * user email, WP_User object, WP_Post object, or WP_Comment object.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int $size Square avatar width and height in pixels to retrieve.
- * @param string $default_value URL for the default image or a default type. Accepts '404', 'retro', 'monsterid',
- * 'wavatar', 'indenticon', 'mystery', 'mm', 'mysteryman', 'blank', or 'gravatar_default'.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int $size Height and width of the avatar in pixels.
+ * @param string $default_value URL for the default image or a default type. Accepts:
+ * - '404' (return a 404 instead of a default image)
+ * - 'retro' (a 8-bit arcade-style pixelated face)
+ * - 'robohash' (a robot)
+ * - 'monsterid' (a monster)
+ * - 'wavatar' (a cartoon face)
+ * - 'identicon' (the "quilt", a geometric pattern)
+ * - 'mystery', 'mm', or 'mysteryman' (The Oyster Man)
+ * - 'blank' (transparent GIF)
+ * - 'gravatar_default' (the Gravatar logo)
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $alt Alternative text to use in the avatar image tag.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $args Arguments passed to get_avatar_data(), after processing.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span></span></pre></div>
<a id="trunksrcwpincludesrestapiphp"></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/rest-api.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/rest-api.php 2023-10-03 15:42:06 UTC (rev 56766)
+++ trunk/src/wp-includes/rest-api.php 2023-10-03 16:13:43 UTC (rev 56767)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1215,13 +1215,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Retrieves the avatar urls in various sizes.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Retrieves the avatar URLs in various sizes.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.7.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @see get_avatar_url()
</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 mixed $id_or_email The Gravatar to retrieve a URL for. Accepts a user_id, gravatar md5 hash,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param mixed $id_or_email The avatar to retrieve a URL for. Accepts a user ID, Gravatar MD5 hash,
</ins><span class="cx" style="display: block; padding: 0 10px"> * user email, WP_User object, WP_Post object, or WP_Comment object.
</span><span class="cx" style="display: block; padding: 0 10px"> * @return (string|false)[] Avatar URLs keyed by size. Each value can be a URL string or boolean false.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span></span></pre>
</div>
</div>
</body>
</html>