Skip to content

Instantly share code, notes, and snippets.

@RomioDiver
RomioDiver / plugins autoptimize_push.php
Last active February 4, 2022 19:54 — forked from tdtgit/functions.php
HTTP/2 Push CSS/JS with Autoptimize WordPress's plugin
<?php
/*
* * Plugin Name: Autoptimize PUSH
* */
add_filter('autoptimize_filter_cache_getname', 'pushAOFiles');
function pushAOFiles($in) {
$pushType = substr($in, strrpos($in, ".") + 1) === "js" ? "script" : "style";
// Do not push CSS files if it is already inline.