Changeset 56037 for trunk/src/wp-includes/pluggable.php
- Timestamp:
- 06/26/2023 04:15:12 PM (20 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/pluggable.php
r55990 r56037 2816 2816 'force_display' => false, 2817 2817 'loading' => null, 2818 'fetchpriority' => null, 2818 2819 'extra_attr' => '', 2819 2820 'decoding' => 'async', 2820 2821 ); 2821 2822 2822 if ( wp_lazy_loading_enabled( 'img', 'get_avatar' ) ) {2823 $defaults['loading'] = wp_get_loading_attr_default( 'get_avatar' );2824 }2825 2826 2823 if ( empty( $args ) ) { 2827 2824 $args = array(); … … 2840 2837 $args['width'] = $args['size']; 2841 2838 } 2839 2840 // Update args with loading optimized attributes. 2841 $loading_optimization_attr = wp_get_loading_optimization_attributes( 'img', $args, 'get_avatar' ); 2842 2843 $args = array_merge( $args, $loading_optimization_attr ); 2842 2844 2843 2845 if ( is_object( $id_or_email ) && isset( $id_or_email->comment_ID ) ) { … … 2893 2895 } 2894 2896 2895 // Add `loading` and `decoding` attributes.2897 // Add `loading`, `fetchpriority` and `decoding` attributes. 2896 2898 $extra_attr = $args['extra_attr']; 2897 2899 … … 2914 2916 2915 2917 $extra_attr .= "decoding='{$args['decoding']}'"; 2918 } 2919 2920 // Add support for `fetchpriority`. 2921 if ( in_array( $args['fetchpriority'], array( 'high', 'low', 'auto' ), true ) 2922 && ! preg_match( '/\bfetchpriority\s*=/', $extra_attr ) 2923 ) { 2924 if ( ! empty( $extra_attr ) ) { 2925 $extra_attr .= ' '; 2926 } 2927 2928 $extra_attr .= "fetchpriority='{$args['fetchpriority']}'"; 2916 2929 } 2917 2930
Note: See TracChangeset
for help on using the changeset viewer.