mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Coding Standards: Remove a one-time $loading variable in get_avatar().
This aims to bring consistency between two similar code fragments. Follow-up to [47554], [53480], [54895]. See #56791. git-svn-id: https://develop.svn.wordpress.org/trunk@54920 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
63df8812d4
commit
5697adcecf
@ -2867,22 +2867,26 @@ if ( ! function_exists( 'get_avatar' ) ) :
|
||||
}
|
||||
}
|
||||
|
||||
// Add `loading` attribute.
|
||||
// Add `loading` and `decoding` attributes.
|
||||
$extra_attr = $args['extra_attr'];
|
||||
$loading = $args['loading'];
|
||||
|
||||
if ( in_array( $loading, array( 'lazy', 'eager' ), true ) && ! preg_match( '/\bloading\s*=/', $extra_attr ) ) {
|
||||
if ( in_array( $args['loading'], array( 'lazy', 'eager' ), true )
|
||||
&& ! preg_match( '/\bloading\s*=/', $extra_attr )
|
||||
) {
|
||||
if ( ! empty( $extra_attr ) ) {
|
||||
$extra_attr .= ' ';
|
||||
}
|
||||
|
||||
$extra_attr .= "loading='{$loading}'";
|
||||
$extra_attr .= "loading='{$args['loading']}'";
|
||||
}
|
||||
|
||||
if ( in_array( $args['decoding'], array( 'async', 'sync', 'auto' ), true ) && ! preg_match( '/\bdecoding\s*=/', $extra_attr ) ) {
|
||||
if ( in_array( $args['decoding'], array( 'async', 'sync', 'auto' ), true )
|
||||
&& ! preg_match( '/\bdecoding\s*=/', $extra_attr )
|
||||
) {
|
||||
if ( ! empty( $extra_attr ) ) {
|
||||
$extra_attr .= ' ';
|
||||
}
|
||||
|
||||
$extra_attr .= "decoding='{$args['decoding']}'";
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user