Changeset 56767
- Timestamp:
- 10/03/2023 04:13:43 PM (22 months ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/link-template.php
r56740 r56767 4251 4251 } 4252 4252 4253 4254 4253 /** 4255 4254 * Retrieves the avatar URL. … … 4257 4256 * @since 4.2.0 4258 4257 * 4259 * @param mixed $id_or_email The Gravatar to retrieve a URL for. Accepts a user_id, gravatar md5 hash,4258 * @param mixed $id_or_email The avatar to retrieve a URL for. Accepts a user ID, Gravatar MD5 hash, 4260 4259 * user email, WP_User object, WP_Post object, or WP_Comment object. 4261 4260 * @param array $args { … … 4263 4262 * 4264 4263 * @type int $size Height and width of the avatar in pixels. Default 96. 4265 * @type string $default URL for the default image or a default type. Accepts '404' (return 4266 * a 404 instead of a default image), 'retro' (8bit), 'RoboHash' (robohash), 4267 * 'monsterid' (monster), 'wavatar' (cartoon face), 'indenticon' (the "quilt"), 4268 * 'mystery', 'mm', or 'mysteryman' (The Oyster Man), 'blank' (transparent GIF), 4269 * or 'gravatar_default' (the Gravatar logo). Default is the value of the 4270 * 'avatar_default' option, with a fallback of 'mystery'. 4271 * @type bool $force_default Whether to always show the default image, never the Gravatar. Default false. 4272 * @type string $rating What rating to display avatars up to. Accepts 'G', 'PG', 'R', 'X', and are 4273 * judged in that order. Default is the value of the 'avatar_rating' option. 4264 * @type string $default URL for the default image or a default type. Accepts: 4265 * - '404' (return a 404 instead of a default image) 4266 * - 'retro' (a 8-bit arcade-style pixelated face) 4267 * - 'robohash' (a robot) 4268 * - 'monsterid' (a monster) 4269 * - 'wavatar' (a cartoon face) 4270 * - 'identicon' (the "quilt", a geometric pattern) 4271 * - 'mystery', 'mm', or 'mysteryman' (The Oyster Man) 4272 * - 'blank' (transparent GIF) 4273 * - 'gravatar_default' (the Gravatar logo) 4274 * Default is the value of the 'avatar_default' option, 4275 * with a fallback of 'mystery'. 4276 * @type bool $force_default Whether to always show the default image, never the Gravatar. 4277 * Default false. 4278 * @type string $rating What rating to display avatars up to. Accepts: 4279 * - 'G' (suitable for all audiences) 4280 * - 'PG' (possibly offensive, usually for audiences 13 and above) 4281 * - 'R' (intended for adult audiences above 17) 4282 * - 'X' (even more mature than above) 4283 * Default is the value of the 'avatar_rating' option. 4274 4284 * @type string $scheme URL scheme to use. See set_url_scheme() for accepted values. 4275 4285 * Default null. … … 4284 4294 } 4285 4295 4286 4287 4296 /** 4288 4297 * Check if this comment type allows avatars to be retrieved. … … 4305 4314 return in_array( $comment_type, (array) $allowed_comment_types, true ); 4306 4315 } 4307 4308 4316 4309 4317 /** … … 4317 4325 * Optional. Arguments to use instead of the default arguments. 4318 4326 * 4319 * @type int $size Height and width of the avatar i mage file in pixels. Default 96.4327 * @type int $size Height and width of the avatar in pixels. Default 96. 4320 4328 * @type int $height Display height of the avatar in pixels. Defaults to $size. 4321 4329 * @type int $width Display width of the avatar in pixels. Defaults to $size. 4322 * @type string $default URL for the default image or a default type. Accepts '404' (return 4323 * a 404 instead of a default image), 'retro' (8bit), 'monsterid' (monster), 4324 * 'wavatar' (cartoon face), 'indenticon' (the "quilt"), 'mystery', 'mm', 4325 * or 'mysteryman' (The Oyster Man), 'blank' (transparent GIF), or 4326 * 'gravatar_default' (the Gravatar logo). Default is the value of the 4327 * 'avatar_default' option, with a fallback of 'mystery'. 4328 * @type bool $force_default Whether to always show the default image, never the Gravatar. Default false. 4329 * @type string $rating What rating to display avatars up to. Accepts 'G', 'PG', 'R', 'X', and are 4330 * judged in that order. Default is the value of the 'avatar_rating' option. 4330 * @type string $default URL for the default image or a default type. Accepts: 4331 * - '404' (return a 404 instead of a default image) 4332 * - 'retro' (a 8-bit arcade-style pixelated face) 4333 * - 'robohash' (a robot) 4334 * - 'monsterid' (a monster) 4335 * - 'wavatar' (a cartoon face) 4336 * - 'identicon' (the "quilt", a geometric pattern) 4337 * - 'mystery', 'mm', or 'mysteryman' (The Oyster Man) 4338 * - 'blank' (transparent GIF) 4339 * - 'gravatar_default' (the Gravatar logo) 4340 * Default is the value of the 'avatar_default' option, 4341 * with a fallback of 'mystery'. 4342 * @type bool $force_default Whether to always show the default image, never the Gravatar. 4343 * Default false. 4344 * @type string $rating What rating to display avatars up to. Accepts: 4345 * - 'G' (suitable for all audiences) 4346 * - 'PG' (possibly offensive, usually for audiences 13 and above) 4347 * - 'R' (intended for adult audiences above 17) 4348 * - 'X' (even more mature than above) 4349 * Default is the value of the 'avatar_rating' option. 4331 4350 * @type string $scheme URL scheme to use. See set_url_scheme() for accepted values. 4332 4351 * Default null. 4333 4352 * @type array $processed_args When the function returns, the value will be the processed/sanitized $args 4334 4353 * plus a "found_avatar" guess. Pass as a reference. Default null. 4335 * @type string $extra_attr HTML attributes to insert in the IMG element. Is not sanitized. Default empty. 4354 * @type string $extra_attr HTML attributes to insert in the IMG element. Is not sanitized. 4355 * Default empty. 4336 4356 * } 4337 4357 * @return array { -
trunk/src/wp-includes/pluggable.php
r56756 r56767 2798 2798 * 2799 2799 * @since 2.5.0 2800 * @since 4.2.0 Optional `$args` parameter added. 2801 * 2802 * @param mixed $id_or_email The Gravatar to retrieve. Accepts a user_id, gravatar md5 hash, 2800 * @since 4.2.0 Added the optional `$args` parameter. 2801 * @since 5.5.0 Added the `loading` argument. 2802 * @since 6.1.0 Added the `decoding` argument. 2803 * @since 6.3.0 Added the `fetchpriority` argument. 2804 * 2805 * @param mixed $id_or_email The avatar to retrieve. Accepts a user ID, Gravatar MD5 hash, 2803 2806 * user email, WP_User object, WP_Post object, or WP_Comment object. 2804 * @param int $size Optional. Height and width of the avatar image file in pixels. Default 96. 2805 * @param string $default_value URL for the default image or a default type. Accepts '404' (return 2806 * a 404 instead of a default image), 'retro' (8bit), 'RoboHash' (robohash), 2807 * 'monsterid' (monster), 'wavatar' (cartoon face), 'indenticon' (the "quilt"), 2808 * 'mystery', 'mm', or 'mysteryman' (The Oyster Man), 'blank' (transparent GIF), 2809 * or 'gravatar_default' (the Gravatar logo). Default is the value of the 2810 * 'avatar_default' option, with a fallback of 'mystery'. 2811 * @param string $alt Optional. Alternative text to use in img tag. Default empty. 2807 * @param int $size Optional. Height and width of the avatar in pixels. Default 96. 2808 * @param string $default_value URL for the default image or a default type. Accepts: 2809 * - '404' (return a 404 instead of a default image) 2810 * - 'retro' (a 8-bit arcade-style pixelated face) 2811 * - 'robohash' (a robot) 2812 * - 'monsterid' (a monster) 2813 * - 'wavatar' (a cartoon face) 2814 * - 'identicon' (the "quilt", a geometric pattern) 2815 * - 'mystery', 'mm', or 'mysteryman' (The Oyster Man) 2816 * - 'blank' (transparent GIF) 2817 * - 'gravatar_default' (the Gravatar logo) 2818 * Default is the value of the 'avatar_default' option, 2819 * with a fallback of 'mystery'. 2820 * @param string $alt Optional. Alternative text to use in the avatar image tag. 2821 * Default empty. 2812 2822 * @param array $args { 2813 2823 * Optional. Extra arguments to retrieve the avatar. … … 2815 2825 * @type int $height Display height of the avatar in pixels. Defaults to $size. 2816 2826 * @type int $width Display width of the avatar in pixels. Defaults to $size. 2817 * @type bool $force_default Whether to always show the default image, never the Gravatar. Default false. 2818 * @type string $rating What rating to display avatars up to. Accepts 'G', 'PG', 'R', 'X', and are 2819 * judged in that order. Default is the value of the 'avatar_rating' option. 2827 * @type bool $force_default Whether to always show the default image, never the Gravatar. 2828 * Default false. 2829 * @type string $rating What rating to display avatars up to. Accepts: 2830 * - 'G' (suitable for all audiences) 2831 * - 'PG' (possibly offensive, usually for audiences 13 and above) 2832 * - 'R' (intended for adult audiences above 17) 2833 * - 'X' (even more mature than above) 2834 * Default is the value of the 'avatar_rating' option. 2820 2835 * @type string $scheme URL scheme to use. See set_url_scheme() for accepted values. 2821 2836 * Default null. … … 2826 2841 * @type string $loading Value for the `loading` attribute. 2827 2842 * Default null. 2828 * @type string $extra_attr HTML attributes to insert in the IMG element. Is not sanitized. Default empty. 2843 * @type string $fetchpriority Value for the `fetchpriority` attribute. 2844 * Default null. 2845 * @type string $decoding Value for the `decoding` attribute. 2846 * Default null. 2847 * @type string $extra_attr HTML attributes to insert in the IMG element. Is not sanitized. 2848 * Default empty. 2829 2849 * } 2830 2850 * @return string|false `<img>` tag for the user's avatar. False on failure. … … 2845 2865 'loading' => null, 2846 2866 'fetchpriority' => null, 2867 'decoding' => null, 2847 2868 'extra_attr' => '', 2848 'decoding' => null,2849 2869 ); 2850 2870 … … 2884 2904 * 2885 2905 * @param string|null $avatar HTML for the user's avatar. Default null. 2886 * @param mixed $id_or_email The avatar to retrieve. Accepts a user _id, Gravatar MD5 hash,2906 * @param mixed $id_or_email The avatar to retrieve. Accepts a user ID, Gravatar MD5 hash, 2887 2907 * user email, WP_User object, WP_Post object, or WP_Comment object. 2888 2908 * @param array $args Arguments passed to get_avatar_url(), after processing. … … 2923 2943 } 2924 2944 2925 // Add `loading`, `fetchpriority` and `decoding` attributes.2945 // Add `loading`, `fetchpriority`, and `decoding` attributes. 2926 2946 $extra_attr = $args['extra_attr']; 2927 2947 … … 2936 2956 } 2937 2957 2958 if ( in_array( $args['fetchpriority'], array( 'high', 'low', 'auto' ), true ) 2959 && ! preg_match( '/\bfetchpriority\s*=/', $extra_attr ) 2960 ) { 2961 if ( ! empty( $extra_attr ) ) { 2962 $extra_attr .= ' '; 2963 } 2964 2965 $extra_attr .= "fetchpriority='{$args['fetchpriority']}'"; 2966 } 2967 2938 2968 if ( in_array( $args['decoding'], array( 'async', 'sync', 'auto' ), true ) 2939 2969 && ! preg_match( '/\bdecoding\s*=/', $extra_attr ) … … 2944 2974 2945 2975 $extra_attr .= "decoding='{$args['decoding']}'"; 2946 }2947 2948 // Add support for `fetchpriority`.2949 if ( in_array( $args['fetchpriority'], array( 'high', 'low', 'auto' ), true )2950 && ! preg_match( '/\bfetchpriority\s*=/', $extra_attr )2951 ) {2952 if ( ! empty( $extra_attr ) ) {2953 $extra_attr .= ' ';2954 }2955 2956 $extra_attr .= "fetchpriority='{$args['fetchpriority']}'";2957 2976 } 2958 2977 … … 2972 2991 * 2973 2992 * @since 2.5.0 2974 * @since 4.2.0 The `$args` parameter was added.2993 * @since 4.2.0 Added the `$args` parameter. 2975 2994 * 2976 2995 * @param string $avatar HTML for the user's avatar. 2977 * @param mixed $id_or_email The avatar to retrieve. Accepts a user _id, Gravatar MD5 hash,2996 * @param mixed $id_or_email The avatar to retrieve. Accepts a user ID, Gravatar MD5 hash, 2978 2997 * user email, WP_User object, WP_Post object, or WP_Comment object. 2979 * @param int $size Square avatar width and height in pixels to retrieve. 2980 * @param string $default_value URL for the default image or a default type. Accepts '404', 'retro', 'monsterid', 2981 * 'wavatar', 'indenticon', 'mystery', 'mm', 'mysteryman', 'blank', or 'gravatar_default'. 2998 * @param int $size Height and width of the avatar in pixels. 2999 * @param string $default_value URL for the default image or a default type. Accepts: 3000 * - '404' (return a 404 instead of a default image) 3001 * - 'retro' (a 8-bit arcade-style pixelated face) 3002 * - 'robohash' (a robot) 3003 * - 'monsterid' (a monster) 3004 * - 'wavatar' (a cartoon face) 3005 * - 'identicon' (the "quilt", a geometric pattern) 3006 * - 'mystery', 'mm', or 'mysteryman' (The Oyster Man) 3007 * - 'blank' (transparent GIF) 3008 * - 'gravatar_default' (the Gravatar logo) 2982 3009 * @param string $alt Alternative text to use in the avatar image tag. 2983 3010 * @param array $args Arguments passed to get_avatar_data(), after processing. -
trunk/src/wp-includes/rest-api.php
r56192 r56767 1216 1216 1217 1217 /** 1218 * Retrieves the avatar urls in various sizes.1218 * Retrieves the avatar URLs in various sizes. 1219 1219 * 1220 1220 * @since 4.7.0 … … 1222 1222 * @see get_avatar_url() 1223 1223 * 1224 * @param mixed $id_or_email The Gravatar to retrieve a URL for. Accepts a user_id, gravatar md5 hash,1224 * @param mixed $id_or_email The avatar to retrieve a URL for. Accepts a user ID, Gravatar MD5 hash, 1225 1225 * user email, WP_User object, WP_Post object, or WP_Comment object. 1226 1226 * @return (string|false)[] Avatar URLs keyed by size. Each value can be a URL string or boolean false.
Note: See TracChangeset
for help on using the changeset viewer.