|
@@ 624-630 (lines=7) @@
|
| 621 |
|
} |
| 622 |
|
|
| 623 |
|
// background-image in inline style. |
| 624 |
|
if ( strpos( $out, 'background-image:' ) !== false && apply_filters( 'autoptimize_filter_imgopt_backgroundimages', true ) ) { |
| 625 |
|
$out = preg_replace_callback( |
| 626 |
|
'/style=(?:"|\')[^<>]*?background-image:\s?url\((?:"|\')?([^"\')]*)(?:"|\')?\)/', |
| 627 |
|
array( $this, 'replace_img_callback' ), |
| 628 |
|
$out |
| 629 |
|
); |
| 630 |
|
} |
| 631 |
|
|
| 632 |
|
// act on icon links. |
| 633 |
|
if ( ( strpos( $out, '<link rel="icon"' ) !== false || ( strpos( $out, "<link rel='icon'" ) !== false ) ) && apply_filters( 'autoptimize_filter_imgopt_linkicon', true ) ) { |
|
@@ 954-961 (lines=8) @@
|
| 951 |
|
} |
| 952 |
|
|
| 953 |
|
public function process_bgimage( $in ) { |
| 954 |
|
if ( strpos( $in, 'background-image:' ) !== false && apply_filters( 'autoptimize_filter_imgopt_lazyload_backgroundimages', true ) ) { |
| 955 |
|
$out = preg_replace_callback( |
| 956 |
|
'/(<(?:article|aside|body|div|footer|header|p|section|table)[^>]*)\sstyle=(?:"|\')[^<>]*?background-image:\s?url\((?:"|\')?([^"\')]*)(?:"|\')?\)[^>]*/', |
| 957 |
|
array( $this, 'lazyload_bgimg_callback' ), |
| 958 |
|
$in |
| 959 |
|
); |
| 960 |
|
return $out; |
| 961 |
|
} |
| 962 |
|
return $in; |
| 963 |
|
} |
| 964 |
|
|