Skip to content

Commit

Permalink
Revert "Eliminate passing version into load callback"
Browse files Browse the repository at this point in the history
This reverts commit bdf96a6.
  • Loading branch information
westonruter committed Apr 23, 2024
1 parent ee85351 commit 36fbaf4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions plugins/speculation-rules/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ static function ( string $global_var_name, string $version, Closure $load ) {
if ( ! isset( $GLOBALS[ $global_var_name ] ) ) {
$bootstrap = static function () use ( $global_var_name ) {
if (
isset( $GLOBALS[ $global_var_name ]['load'] )
isset( $GLOBALS[ $global_var_name ]['load'], $GLOBALS[ $global_var_name ]['version'] )
&&
$GLOBALS[ $global_var_name ]['load'] instanceof Closure
&&
is_string( $GLOBALS[ $global_var_name ]['version'] )
) {
call_user_func( $GLOBALS[ $global_var_name ]['load'] );
call_user_func( $GLOBALS[ $global_var_name ]['load'], $GLOBALS[ $global_var_name ]['version'] );
unset( $GLOBALS[ $global_var_name ] );
}
};
Expand Down Expand Up @@ -64,14 +66,14 @@ static function ( string $global_var_name, string $version, Closure $load ) {
)(
'plsr_pending_plugin_info',
'1.2.2',
static function () {
static function ( string $version ) {

// Define the constant.
if ( defined( 'SPECULATION_RULES_VERSION' ) ) {
return;
}

define( 'SPECULATION_RULES_VERSION', '1.2.1' );
define( 'SPECULATION_RULES_VERSION', $version );
define( 'SPECULATION_RULES_MAIN_FILE', plugin_basename( __FILE__ ) );

require_once __DIR__ . '/class-plsr-url-pattern-prefixer.php';
Expand Down

0 comments on commit 36fbaf4

Please sign in to comment.