Ticket #44033: 44033.diff
File 44033.diff, 1.8 KB (added by , 3 years ago) |
---|
-
src/wp-includes/link-template.php
3927 3927 return $args['url']; 3928 3928 } 3929 3929 3930 3931 /** 3932 * Is this an allowed comment type for retrieving avatars. 3933 * 3934 * @since 4.9.7 3935 * 3936 * @param string $comment_type Comment Type 3937 * 3938 * @return false|string The URL of the avatar we found, or false if we couldn't find an avatar. 3939 */ 3940 function is_avatar_comment_type( $comment_type ) { 3941 /** 3942 * Filters the list of allowed comment types for retrieving avatars. 3943 * 3944 * @since 3.0.0 3945 * 3946 * @param array $types An array of content types. Default only contains 'comment'. 3947 */ 3948 $allowed_comment_types = apply_filters( 'get_avatar_comment_types', array( 'comment' ) ); 3949 return in_array( $comment_type, (array) $allowed_comment_types ); 3950 } 3951 3952 3930 3953 /** 3931 3954 * Retrieves default data about the avatar. 3932 3955 * … … 4071 4094 // Post Object 4072 4095 $user = get_user_by( 'id', (int) $id_or_email->post_author ); 4073 4096 } elseif ( $id_or_email instanceof WP_Comment ) { 4074 /** 4075 * Filters the list of allowed comment types for retrieving avatars. 4076 * 4077 * @since 3.0.0 4078 * 4079 * @param array $types An array of content types. Default only contains 'comment'. 4080 */ 4081 $allowed_comment_types = apply_filters( 'get_avatar_comment_types', array( 'comment' ) ); 4082 if ( ! empty( $id_or_email->comment_type ) && ! in_array( $id_or_email->comment_type, (array) $allowed_comment_types ) ) { 4097 if ( ! is_avatar_comment_type( get_comment_type( $id_or_email ) ) ) { 4083 4098 $args['url'] = false; 4084 4099 /** This filter is documented in wp-includes/link-template.php */ 4085 4100 return apply_filters( 'get_avatar_data', $args, $id_or_email );