Skip to content

Commit fbb6076

Browse files
Rename add_preload_link to add_image_preload_link
Co-authored-by: felixarntz <[email protected]>
1 parent 514c513 commit fbb6076

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

plugins/image-prioritizer/class-image-prioritizer-background-image-styled-tag-visitor.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ final class Image_Prioritizer_Background_Image_Styled_Tag_Visitor extends Image_
4545
/**
4646
* Tuples of URL Metric group and the common LCP element external background image.
4747
*
48+
* @since n.e.x.t
4849
* @var array<array{OD_URL_Metric_Group, LcpElementExternalBackgroundImage}>
4950
*/
5051
private $group_common_lcp_element_external_background_images;
@@ -87,7 +88,7 @@ public function __invoke( OD_Tag_Visitor_Context $context ): bool {
8788

8889
// If this element is the LCP (for a breakpoint group), add a preload link for it.
8990
foreach ( $context->url_metric_group_collection->get_groups_by_lcp_element( $xpath ) as $group ) {
90-
$this->add_preload_link( $context->link_collection, $group, $background_image_url );
91+
$this->add_image_preload_link( $context->link_collection, $group, $background_image_url );
9192
}
9293

9394
$this->lazy_load_bg_images( $context );
@@ -169,7 +170,7 @@ private function maybe_preload_external_lcp_background_image( OD_Tag_Visitor_Con
169170
&&
170171
$processor->get_attribute( 'class' ) === $common['class'] // May be checking equality with null.
171172
) {
172-
$this->add_preload_link( $context->link_collection, $group, $common['url'] );
173+
$this->add_image_preload_link( $context->link_collection, $group, $common['url'] );
173174

174175
// Now that the preload link has been added, eliminate the entry to stop looking for it while iterating over the rest of the document.
175176
unset( $this->group_common_lcp_element_external_background_images[ $i ] );
@@ -186,7 +187,7 @@ private function maybe_preload_external_lcp_background_image( OD_Tag_Visitor_Con
186187
* @param OD_URL_Metric_Group $group URL Metric group.
187188
* @param non-empty-string $url Image URL.
188189
*/
189-
private function add_preload_link( OD_Link_Collection $link_collection, OD_URL_Metric_Group $group, string $url ): void {
190+
private function add_image_preload_link( OD_Link_Collection $link_collection, OD_URL_Metric_Group $group, string $url ): void {
190191
$link_collection->add_link(
191192
array(
192193
'rel' => 'preload',

0 commit comments

Comments
 (0)