Skip to content

Commit

Permalink
Stats: Update stats bar lazy loading adminbar image (#40865)
Browse files Browse the repository at this point in the history
* Stats: update the loading of the image in the stats bar to load lazy

* changelog

* update html for use lowercase
  • Loading branch information
enejb authored Jan 7, 2025
1 parent 43b82cf commit d9ffdb8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: other

Load the adminbar stats graph lazily"
2 changes: 1 addition & 1 deletion projects/plugins/jetpack/modules/stats.php
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ function stats_admin_bar_menu( &$wp_admin_bar ) {
$menu = array(
'id' => 'stats',
'href' => add_query_arg( 'page', 'stats', admin_url( 'admin.php' ) ), // no menu_page_url() blog-side.
'title' => "<div><img src='$img_src' srcset='$img_src 1x, $img_src_2x 2x' width='112' height='24' alt='$alt' title='$title'></div>",
'title' => "<div><img fetchpriority='low' loading='lazy' decoding='async' src='$img_src' srcset='$img_src 1x, $img_src_2x 2x' width='112' height='24' alt='$alt' title='$title'></div>",
);

$wp_admin_bar->add_menu( $menu );
Expand Down

0 comments on commit d9ffdb8

Please sign in to comment.