9 | | Alternatively somebody could add a filter snippet to the documentation, that maybe me, do I just do something like below? I don't know what I would put in ??? to check against src since the array has the filepaths. |
10 | | |
11 | | {{{ |
12 | | // Parse through array to unset the original src |
13 | | foreach($sources as $elementKey => $element) { |
14 | | foreach($element as $width => $source) { |
15 | | if($source == ???){ |
16 | | unset($array[$width]); |
17 | | } |
18 | | } |
19 | | } |
20 | | // Move largest derivative to first position. |
21 | | $largest_img_key = max(array_keys($sources)); |
22 | | $sources = array( $largest_img_key => $sources[$largest_img_key]) + $sources; |
23 | | }}} |
| 9 | Alternatively somebody could add a filter snippet to the documentation, that maybe me |