Skip to content

Commit

Permalink
Fix loading translation on WordPress 6.7
Browse files Browse the repository at this point in the history
  • Loading branch information
doekenorg committed Nov 25, 2024
1 parent 3f72320 commit 6e802b8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
14 changes: 8 additions & 6 deletions gfexcel.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Plugin Name: GravityExport Lite
* Version: 2.3.4
* Version: 2.3.5
* Plugin URI: https://gfexcel.com
* Description: Export all Gravity Forms entries to Excel (.xlsx) or CSV via a secret shareable URL.
* Author: GravityKit
Expand All @@ -28,7 +28,7 @@
}

if ( ! defined( 'GFEXCEL_PLUGIN_VERSION' ) ) {
define( 'GFEXCEL_PLUGIN_VERSION', '2.3.4' );
define( 'GFEXCEL_PLUGIN_VERSION', '2.3.5' );
}

if ( ! defined( 'GFEXCEL_MIN_PHP_VERSION' ) ) {
Expand All @@ -46,13 +46,15 @@
return;
}

add_action( 'init', static function (): void {
load_plugin_textdomain( 'gk-gravityexport-lite', false, basename( __DIR__ ) . '/languages' );
} );

add_action( 'gform_loaded', static function (): void {
if ( ! class_exists( 'GFForms' ) || ! method_exists( 'GFForms', 'include_addon_framework' ) ) {
return;
}

load_plugin_textdomain( 'gk-gravityexport-lite', false, basename( __DIR__ ) . '/languages' );

GFForms::include_addon_framework();
GFForms::include_feed_addon_framework();

Expand Down Expand Up @@ -94,7 +96,7 @@ class_alias( 'GFExcel\Vendor\\' . $alias, $alias );

// Also autoload any old class as possible class aliases.
spl_autoload_register( function ( string $class ) {
if (strpos( $class, 'PhpOffice\\PhpSpreadsheet\\' ) === 0) {
if ( strpos( $class, 'PhpOffice\\PhpSpreadsheet\\' ) === 0 ) {
$target = 'GFExcel\\Vendor\\' . $class;
if ( class_exists( $target ) || interface_exists( $target ) ) {
class_alias( $target, $class );
Expand All @@ -104,7 +106,7 @@ class_alias( $target, $class );
}

// Start DI container.
$container = (new Container())
$container = ( new Container() )
// add internal service provider
->addServiceProvider( new BaseServiceProvider() )
->addServiceProvider( new AddOnProvider() );
Expand Down
6 changes: 5 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Tags: Gravity Forms, GravityForms, Excel, Export, Entries
Requires at least: 4.0
Requires PHP: 7.2
Tested up to: 6.7
Stable tag: 2.3.4
Stable tag: 2.3.5
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -256,6 +256,10 @@ You can hide a row by adding a hook. Checkout this example:

== Changelog ==

= 2.3.5 on November 25, 2024 =

* Fixed: PHP notice in WordPress 6.7 caused by initializing product translations too early.

= 2.3.4 on November 6, 2024 =

* Fixed: Critical error in combination with GravityExport and PHP 8.
Expand Down

0 comments on commit 6e802b8

Please sign in to comment.