SHOW:
|
|
- or go back to the newest paste.
1 | <?php | |
2 | ||
3 | - | add_filter('swift_performance_option_delay-async-scripts', function($value){ |
3 | + | add_filter('swift_performance_option_block-scripts', function($scripts){ |
4 | $pages = array( | |
5 | '', // use empty for homepage | |
6 | '/contact', | |
7 | '/reservation', | |
8 | ); | |
9 | if (isset($_SERVER['REQUEST_URI']) && in_array(trim(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH),'/'), $pages)){ | |
10 | - | return 0; |
10 | + | $scripts[] = 'any-script.js'; |
11 | $scripts[] = 'other-script.js'; | |
12 | - | return $value; |
12 | + | |
13 | return $scripts; | |
14 | }); | |
15 | ||
16 |