Skip to content

Commit

Permalink
Call wp_print_scripts action to include all scripts (#34)
Browse files Browse the repository at this point in the history
* Call wp_print_scripts action to include all scripts

* Update branch alias
  • Loading branch information
ocean90 authored Jan 11, 2024
1 parent 2f67afc commit 045a8ef
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "2.1-dev"
"dev-master": "2.2-dev"
}
},
"minimum-stability": "dev",
Expand Down
13 changes: 11 additions & 2 deletions h2push.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
* Plugin Name: HTTP/2 Server Push
* Plugin URI: https://github.com/wearerequired/h2push/
* Description: Sends Link headers to bring HTTP/2 Server Push for scripts and styles to WordPress.
* Version: 2.2.0
* Version: 2.2.1-beta
* Requires at least: 5.6
* Requires PHP: 7.4
* Author: required
* Author URI: https://required.com
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
*
* Copyright (c) 2017-2022 required (email: [email protected])
* Copyright (c) 2017-2024 required (email: [email protected])
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License, version 2 or, at
Expand Down Expand Up @@ -230,6 +230,15 @@ function get_push_resources(): array {
}

// Scripts.

// Core and plugins may add more dependencies during `wp_print_scripts`.
// Example: wp-interactivity for blocks.
if ( ! did_action( 'wp_print_scripts' ) ) {
ob_start();
do_action( 'wp_print_scripts' ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound
ob_end_clean();
}

$wp_scripts = wp_scripts();
$wp_scripts->all_deps( $wp_scripts->queue );
$files = $wp_scripts->to_do;
Expand Down

0 comments on commit 045a8ef

Please sign in to comment.